Skip to content

Commit

Permalink
OSS Presto OTel Tracing changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sureshbabu-areekara committed Nov 25, 2024
1 parent 941e428 commit edeed24
Show file tree
Hide file tree
Showing 151 changed files with 4,123 additions and 2,939 deletions.
33 changes: 24 additions & 9 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.38</dep.drift.version>
Expand Down Expand Up @@ -97,6 +97,9 @@
<grpc.version>1.64.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 @@ -2200,19 +2203,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 @@ -2224,31 +2227,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 @@ -2298,6 +2307,12 @@
<artifactId>cassandra-driver-core</artifactId>
<version>3.11.5</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 @@ -83,7 +83,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 @@ -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
5 changes: 5 additions & 0 deletions presto-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,5 +114,10 @@
<artifactId>drift-protocol</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-context</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
Loading

0 comments on commit edeed24

Please sign in to comment.