Skip to content

Commit

Permalink
OSS Presto OTel Tracing changes
Browse files Browse the repository at this point in the history
OSS Presto OTel Tracing changes

Co-Authored-By: Steve Burnett <burnett@pobox.com>
  • Loading branch information
sureshbabu-areekara and steveburnett committed Feb 7, 2025
1 parent 16b447b commit e32d0c5
Show file tree
Hide file tree
Showing 157 changed files with 5,479 additions and 2,866 deletions.
34 changes: 24 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<dep.slice.version>0.38</dep.slice.version>
<dep.testing-mysql-server-5.version>0.6</dep.testing-mysql-server-5.version>
<dep.aws-sdk.version>1.12.560</dep.aws-sdk.version>
<dep.okhttp.version>3.9.0</dep.okhttp.version>
<dep.okhttp.version>4.12.0</dep.okhttp.version>
<dep.jdbi3.version>3.4.0</dep.jdbi3.version>
<dep.oracle.version>19.3.0.0</dep.oracle.version>
<dep.drift.version>1.40</dep.drift.version>
Expand Down Expand Up @@ -105,6 +105,9 @@
<grpc.version>1.68.0</grpc.version>

<air.javadoc.lint>-missing</air.javadoc.lint>
<opentelemetry.version>1.38.0</opentelemetry.version>
<opentelemetry-alpha.version>1.38.0-alpha</opentelemetry-alpha.version>
<kotlin-stdlib-jdk8.version>1.9.10</kotlin-stdlib-jdk8.version>
</properties>

<modules>
Expand Down Expand Up @@ -2329,19 +2332,19 @@
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-api</artifactId>
<version>1.19.0</version>
<version>${opentelemetry.version}</version>
</dependency>

<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-context</artifactId>
<version>1.19.0</version>
<version>${opentelemetry.version}</version>
</dependency>

<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-exporter-otlp</artifactId>
<version>1.19.0</version>
<version>${opentelemetry.version}</version>
<exclusions>
<exclusion>
<groupId>com.squareup.okhttp3</groupId>
Expand All @@ -2353,31 +2356,37 @@
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-extension-trace-propagators</artifactId>
<version>1.19.0</version>
<version>${opentelemetry.version}</version>
</dependency>

<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-sdk</artifactId>
<version>1.19.0</version>
<version>${opentelemetry.version}</version>
</dependency>

<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-sdk-testing</artifactId>
<version>${opentelemetry.version}</version>
</dependency>

<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-sdk-common</artifactId>
<version>1.19.0</version>
<version>${opentelemetry.version}</version>
</dependency>

<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-sdk-trace</artifactId>
<version>1.19.0</version>
<version>${opentelemetry.version}</version>
</dependency>

<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-semconv</artifactId>
<version>1.19.0-alpha</version>
<version>${opentelemetry-alpha.version}</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -2475,7 +2484,12 @@
<artifactId>flight-core</artifactId>
<version>${dep.arrow.version}</version>
</dependency>


<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
<version>${kotlin-stdlib-jdk8.version}</version>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ public ClientSession getClientSession()
parseServer(server),
user,
"presto-benchmark",
Optional.empty(),
ImmutableSet.of(),
null,
catalog,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ public class TestCassandraConnector
"user",
new ConnectorIdentity("user", Optional.empty(), Optional.empty()),
Optional.of("test"),
Optional.empty(),
UTC_KEY,
ENGLISH,
System.currentTimeMillis(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ public ClientSession toClientSession()
parseServer(server),
user,
source,
Optional.empty(),
parseClientTags(clientTags),
clientInfo,
catalog,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ protected ClientSession createMockClientSession()
server.url("/").uri(),
"user",
"source",
Optional.empty(),
ImmutableSet.of(),
"clientInfo",
"catalog",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import java.util.Locale;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Optional;
import java.util.Set;

import static com.google.common.base.MoreObjects.toStringHelper;
Expand All @@ -37,7 +36,6 @@ public class ClientSession
private final URI server;
private final String user;
private final String source;
private final Optional<String> traceToken;
private final Set<String> clientTags;
private final String clientInfo;
private final String catalog;
Expand Down Expand Up @@ -72,7 +70,6 @@ public ClientSession(
URI server,
String user,
String source,
Optional<String> traceToken,
Set<String> clientTags,
String clientInfo,
String catalog,
Expand All @@ -94,7 +91,6 @@ public ClientSession(
this.server = requireNonNull(server, "server is null");
this.user = user;
this.source = source;
this.traceToken = requireNonNull(traceToken, "traceToken is null");
this.clientTags = ImmutableSet.copyOf(requireNonNull(clientTags, "clientTags is null"));
this.clientInfo = clientInfo;
this.catalog = catalog;
Expand Down Expand Up @@ -165,11 +161,6 @@ public String getSource()
return source;
}

public Optional<String> getTraceToken()
{
return traceToken;
}

public Set<String> getClientTags()
{
return clientTags;
Expand Down Expand Up @@ -273,7 +264,6 @@ public String toString()
.add("clientInfo", clientInfo)
.add("catalog", catalog)
.add("schema", schema)
.add("traceToken", traceToken.orElse(null))
.add("timeZone", timeZone)
.add("locale", locale)
.add("properties", properties)
Expand All @@ -287,7 +277,6 @@ public static final class Builder
private URI server;
private String user;
private String source;
private Optional<String> traceToken;
private Set<String> clientTags;
private String clientInfo;
private String catalog;
Expand All @@ -312,7 +301,6 @@ private Builder(ClientSession clientSession)
server = clientSession.getServer();
user = clientSession.getUser();
source = clientSession.getSource();
traceToken = clientSession.getTraceToken();
clientTags = clientSession.getClientTags();
clientInfo = clientSession.getClientInfo();
catalog = clientSession.getCatalog();
Expand Down Expand Up @@ -410,7 +398,6 @@ public ClientSession build()
server,
user,
source,
traceToken,
clientTags,
clientInfo,
catalog,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package com.facebook.presto.client;

import com.facebook.airlift.security.pem.PemReader;
import com.facebook.presto.client.okhttp3.internal.tls.LegacyHostnameVerifier;
import com.google.common.base.CharMatcher;
import com.google.common.net.HostAndPort;
import okhttp3.Call;
Expand Down Expand Up @@ -237,6 +238,7 @@ public static void setupSsl(
sslContext.init(keyManagers, new TrustManager[] {trustManager}, null);

clientBuilder.sslSocketFactory(sslContext.getSocketFactory(), trustManager);
clientBuilder.hostnameVerifier(LegacyHostnameVerifier.INSTANCE);
}
catch (GeneralSecurityException | IOException e) {
throw new ClientException("Error setting up SSL: " + e.getMessage(), e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ public final class PrestoHeaders
public static final String PRESTO_SCHEMA = "X-Presto-Schema";
public static final String PRESTO_TIME_ZONE = "X-Presto-Time-Zone";
public static final String PRESTO_LANGUAGE = "X-Presto-Language";
public static final String PRESTO_TRACE_TOKEN = "X-Presto-Trace-Token";
public static final String PRESTO_SESSION = "X-Presto-Session";
public static final String PRESTO_SET_CATALOG = "X-Presto-Set-Catalog";
public static final String PRESTO_SET_SCHEMA = "X-Presto-Set-Schema";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
import static com.facebook.presto.client.PrestoHeaders.PRESTO_SOURCE;
import static com.facebook.presto.client.PrestoHeaders.PRESTO_STARTED_TRANSACTION_ID;
import static com.facebook.presto.client.PrestoHeaders.PRESTO_TIME_ZONE;
import static com.facebook.presto.client.PrestoHeaders.PRESTO_TRACE_TOKEN;
import static com.facebook.presto.client.PrestoHeaders.PRESTO_TRANSACTION_ID;
import static com.facebook.presto.client.PrestoHeaders.PRESTO_USER;
import static com.google.common.base.MoreObjects.firstNonNull;
Expand Down Expand Up @@ -163,8 +162,6 @@ private Request buildQueryRequest(ClientSession session, String query)
builder.addHeader(PRESTO_SOURCE, session.getSource());
}

session.getTraceToken().ifPresent(token -> builder.addHeader(PRESTO_TRACE_TOKEN, token));

if (session.getClientTags() != null && !session.getClientTags().isEmpty()) {
builder.addHeader(PRESTO_CLIENT_TAGS, Joiner.on(",").join(session.getClientTags()));
}
Expand Down
Loading

0 comments on commit e32d0c5

Please sign in to comment.