Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Airlift's trace token #23593

Merged
merged 3 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public int hashCode()

@JsonCreator
@DoNotCall
public static DataAttributes fromMap(Map<String, Object> attributes)
public static DataAttributes fromMap(@JsonProperty("attributes") Map<String, Object> attributes)
wendigo marked this conversation as resolved.
Show resolved Hide resolved
{
Builder builder = DataAttributes.builder();
attributes.forEach(builder::set); // Fixes the types after the deserialization
Expand Down
5 changes: 0 additions & 5 deletions core/trino-main/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,6 @@
<artifactId>stats</artifactId>
</dependency>

<dependency>
<groupId>io.airlift</groupId>
<artifactId>trace-token</artifactId>
</dependency>

<dependency>
<groupId>io.airlift</groupId>
<artifactId>tracing</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ public class FailureDetectorModule
protected void setup(Binder binder)
{
install(internalHttpClientModule("failure-detector", ForFailureDetector.class)
.withTracing()
.build());

configBinder(binder).bindConfig(FailureDetectorConfig.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ protected void setup(Binder binder)
// cluster memory manager
binder.bind(ClusterMemoryManager.class).in(Scopes.SINGLETON);
install(internalHttpClientModule("memoryManager", ForMemoryManager.class)
.withTracing()
.withConfigDefaults(config -> {
config.setIdleTimeout(new Duration(30, SECONDS));
config.setRequestTimeout(new Duration(10, SECONDS));
Expand Down Expand Up @@ -331,8 +330,6 @@ List<OutputStatsEstimatorFactory> getCompositeOutputDataSizeEstimatorDelegateFac
newExporter(binder).export(RemoteTaskStats.class).withGeneratedName();

install(internalHttpClientModule("scheduler", ForScheduler.class)
.withTracing()
.withFilter(GenerateTraceTokenRequestFilter.class)
.withConfigDefaults(config -> {
config.setIdleTimeout(new Duration(60, SECONDS));
config.setRequestTimeout(new Duration(20, SECONDS));
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,17 @@ public class InternalCommunicationHttpClientModule
{
private final String clientName;
private final Class<? extends Annotation> annotation;
private final boolean withTracing;
private final Consumer<HttpClientConfig> configDefaults;
private final List<Class<? extends HttpRequestFilter>> filters;

private InternalCommunicationHttpClientModule(
String clientName,
Class<? extends Annotation> annotation,
boolean withTracing,
Consumer<HttpClientConfig> configDefaults,
List<Class<? extends HttpRequestFilter>> filters)
{
this.clientName = requireNonNull(clientName, "clientName is null");
this.annotation = requireNonNull(annotation, "annotation is null");
this.withTracing = withTracing;
this.configDefaults = requireNonNull(configDefaults, "configDefaults is null");
this.filters = ImmutableList.copyOf(requireNonNull(filters, "filters is null"));
}
Expand All @@ -62,11 +59,6 @@ protected void setup(Binder binder)
});

httpClientBindingBuilder.addFilterBinding().to(InternalAuthenticationManager.class);

if (withTracing) {
httpClientBindingBuilder.withTracing();
}

filters.forEach(httpClientBindingBuilder::withFilter);
}

Expand Down Expand Up @@ -101,7 +93,6 @@ public static class Builder
{
private final String clientName;
private final Class<? extends Annotation> annotation;
private boolean withTracing;
private Consumer<HttpClientConfig> configDefaults = config -> {};
private final List<Class<? extends HttpRequestFilter>> filters = new ArrayList<>();

Expand All @@ -111,12 +102,6 @@ private Builder(String clientName, Class<? extends Annotation> annotation)
this.annotation = requireNonNull(annotation, "annotation is null");
}

public Builder withTracing()
{
this.withTracing = true;
return this;
}

public Builder withConfigDefaults(Consumer<HttpClientConfig> configDefaults)
{
this.configDefaults = requireNonNull(configDefaults, "configDefaults is null");
Expand All @@ -131,7 +116,7 @@ public Builder withFilter(Class<? extends HttpRequestFilter> requestFilter)

public InternalCommunicationHttpClientModule build()
{
return new InternalCommunicationHttpClientModule(clientName, annotation, withTracing, configDefaults, filters);
return new InternalCommunicationHttpClientModule(clientName, annotation, configDefaults, filters);
}
}

Expand Down
2 changes: 0 additions & 2 deletions core/trino-main/src/main/java/io/trino/server/Server.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import io.airlift.log.Logger;
import io.airlift.node.NodeModule;
import io.airlift.openmetrics.JmxOpenMetricsModule;
import io.airlift.tracetoken.TraceTokenModule;
import io.airlift.tracing.TracingModule;
import io.airlift.units.Duration;
import io.trino.client.NodeVersion;
Expand Down Expand Up @@ -122,7 +121,6 @@ private void doStart(String trinoVersion)
new JmxHttpModule(),
new JmxOpenMetricsModule(),
new LogJmxModule(),
new TraceTokenModule(),
new TracingModule("trino", trinoVersion),
new EventModule(),
new JsonEventModule(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ protected void setup(Binder binder)
binder.bind(InternalNodeManager.class).to(DiscoveryNodeManager.class).in(Scopes.SINGLETON);
newExporter(binder).export(DiscoveryNodeManager.class).withGeneratedName();
install(internalHttpClientModule("node-manager", ForNodeManager.class)
.withTracing()
.withConfigDefaults(config -> {
config.setIdleTimeout(new Duration(30, SECONDS));
config.setRequestTimeout(new Duration(10, SECONDS));
Expand Down Expand Up @@ -346,8 +345,6 @@ protected void setup(Binder binder)
// exchange client
binder.bind(DirectExchangeClientSupplier.class).to(DirectExchangeClientFactory.class).in(Scopes.SINGLETON);
install(internalHttpClientModule("exchange", ForExchange.class)
.withTracing()
.withFilter(GenerateTraceTokenRequestFilter.class)
.withConfigDefaults(config -> {
config.setIdleTimeout(new Duration(30, SECONDS));
config.setRequestTimeout(new Duration(10, SECONDS));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import io.airlift.json.JsonCodec;
import io.airlift.log.Logger;

Expand All @@ -27,7 +28,6 @@
import java.security.interfaces.RSAPublicKey;
import java.security.spec.ECParameterSpec;
import java.security.spec.ECPoint;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
Expand Down Expand Up @@ -246,15 +246,17 @@ public static class Key
{
private final String kty;
private final Optional<String> kid;
private final Map<String, Object> other = new HashMap<>();
private final Map<String, Object> other;

@JsonCreator
public Key(
@JsonProperty("kty") String kty,
@JsonProperty("kid") Optional<String> kid)
@JsonProperty("kid") Optional<String> kid,
@JsonAnySetter Map<String, Object> other)
{
this.kty = requireNonNull(kty, "kty is null");
this.kid = requireNonNull(kid, "kid is null");
this.other = ImmutableMap.copyOf(other);
}

public String getKty()
Expand All @@ -275,11 +277,5 @@ public Optional<String> getStringProperty(String name)
}
return Optional.empty();
}

@JsonAnySetter
public void set(String name, Object value)
{
other.put(name, value);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
import io.airlift.log.Logging;
import io.airlift.node.testing.TestingNodeModule;
import io.airlift.openmetrics.JmxOpenMetricsModule;
import io.airlift.tracetoken.TraceTokenModule;
import io.airlift.tracing.TracingModule;
import io.opentelemetry.api.trace.Span;
import io.opentelemetry.sdk.trace.SpanProcessor;
Expand Down Expand Up @@ -304,7 +303,6 @@ private TestingTrinoServer(
.add(new TestingJmxModule())
.add(new JmxOpenMetricsModule())
.add(new EventModule())
.add(new TraceTokenModule())
.add(new TracingModule("trino", VERSION))
.add(new ServerSecurityModule())
.add(new CatalogManagerModule())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import io.airlift.json.JsonModule;
import io.airlift.json.ObjectMapperProvider;
import io.airlift.node.testing.TestingNodeModule;
import io.airlift.tracetoken.TraceTokenModule;
import io.trino.execution.QueryManagerConfig;
import io.trino.failuredetector.HeartbeatFailureDetector.Stats;
import io.trino.server.InternalCommunicationConfig;
Expand Down Expand Up @@ -54,7 +53,6 @@ public void testExcludesCurrentNode()
new TestingJmxModule(),
new TestingDiscoveryModule(),
new TestingHttpServerModule(),
new TraceTokenModule(),
new JsonModule(),
new JaxrsModule(),
new FailureDetectorModule(),
Expand Down
Loading