From 11cc01889358a8457ad55bef0c82187518fe33d0 Mon Sep 17 00:00:00 2001 From: Mateusz Rzeszutek Date: Mon, 25 Jul 2022 21:02:46 +0200 Subject: [PATCH] Rename `newInstrumenter()` into `buildInstrumenter()` (#6363) * Rename newInstrumenter() into buildInstrumenter() * spotless --- .../http/HttpRouteHolderTest.java | 2 +- .../instrumenter/InstrumenterBenchmark.java | 2 +- .../api/instrumenter/InstrumenterBuilder.java | 89 +++++++++++++++++-- .../api/instrumenter/InstrumenterTest.java | 31 +++---- .../client/AkkaHttpClientSingletons.java | 2 +- .../server/AkkaHttpServerSingletons.java | 2 +- .../apachecamel/CamelSingletons.java | 2 +- .../v2_7/DubboTelemetryBuilder.java | 4 +- .../ApacheHttpAsyncClientSingletons.java | 2 +- .../v2_0/ApacheHttpClientSingletons.java | 2 +- .../v4_0/ApacheHttpClientSingletons.java | 2 +- .../ApacheHttpClientTelemetryBuilder.java | 2 +- .../v5_0/ApacheHttpClientSingletons.java | 2 +- .../armeria/v1_3/ArmeriaTelemetryBuilder.java | 4 +- .../v1_9/AsyncHttpClientSingletons.java | 2 +- .../v2_0/AsyncHttpClientSingletons.java | 2 +- .../AwsLambdaFunctionInstrumenterFactory.java | 2 +- .../AwsLambdaEventsInstrumenterFactory.java | 2 +- .../AwsLambdaSqsInstrumenterFactory.java | 4 +- .../v1_11/AwsSdkInstrumenterFactory.java | 2 +- .../v2_2/AwsSdkInstrumenterFactory.java | 2 +- .../cassandra/v3_0/CassandraSingletons.java | 2 +- .../cassandra/v4_0/CassandraSingletons.java | 2 +- .../couchbase/v2_0/CouchbaseSingletons.java | 2 +- .../dropwizardviews/DropwizardSingletons.java | 2 +- .../ElasticsearchRestInstrumenterFactory.java | 2 +- ...ticsearchTransportInstrumenterFactory.java | 2 +- .../ExternalAnnotationSingletons.java | 2 +- .../finatra/FinatraSingletons.java | 2 +- .../geode/GeodeSingletons.java | 2 +- .../GoogleHttpClientSingletons.java | 2 +- .../grails/GrailsSingletons.java | 2 +- .../graphql/GraphQLTelemetry.java | 2 +- .../grizzly/GrizzlySingletons.java | 2 +- .../grpc/v1_6/GrpcTelemetryBuilder.java | 4 +- .../instrumentation/gwt/GwtSingletons.java | 2 +- .../HibernateInstrumenterFactory.java | 2 +- .../HttpUrlConnectionSingletons.java | 2 +- .../hystrix/HystrixSingletons.java | 2 +- .../httpclient/JdkHttpClientSingletons.java | 2 +- .../v1_1/JaxRsClientSingletons.java | 2 +- .../jaxrs/v1_0/JaxrsSingletons.java | 2 +- .../jaxrs/JaxrsInstrumenterFactory.java | 2 +- .../axis2/Axis2Singletons.java | 2 +- .../instrumentation/cxf/CxfSingletons.java | 2 +- .../metro/MetroSingletons.java | 2 +- .../common/JaxWsInstrumenterFactory.java | 2 +- .../instrumentation/jdbc/JdbcSingletons.java | 2 +- .../jdbc/internal/DataSourceSingletons.java | 2 +- .../jdbc/internal/JdbcSingletons.java | 2 +- .../jedis/v1_4/JedisSingletons.java | 2 +- .../jedis/v3_0/JedisSingletons.java | 2 +- .../jedis/v4_0/JedisSingletons.java | 2 +- .../JettyClientInstrumenterBuilder.java | 2 +- .../instrumentation/jms/JmsSingletons.java | 6 +- .../mojarra/MojarraSingletons.java | 2 +- .../myfaces/MyFacesSingletons.java | 2 +- .../HttpJspPageInstrumentationSingletons.java | 2 +- ...ationContextInstrumentationSingletons.java | 2 +- .../internal/KafkaInstrumenterFactory.java | 12 +-- .../ktor/v1_0/KtorServerTracing.kt | 2 +- .../ktor/v2_0/KtorServerTracing.kt | 2 +- .../KubernetesClientSingletons.java | 2 +- .../lettuce/v4_0/LettuceSingletons.java | 4 +- .../lettuce/v5_0/LettuceSingletons.java | 4 +- .../LibertyDispatcherSingletons.java | 2 +- .../methods/MethodSingletons.java | 2 +- .../mongo/v3_1/MongoInstrumenterFactory.java | 2 +- .../v3_8/client/NettyClientSingletons.java | 4 +- .../v3_8/server/NettyServerSingletons.java | 2 +- .../NettyClientInstrumenterFactory.java | 6 +- .../NettyServerInstrumenterFactory.java | 2 +- .../okhttp/v2_2/OkHttp2Singletons.java | 2 +- .../okhttp/v3_0/OkHttpTelemetryBuilder.java | 2 +- .../WithSpanSingletons.java | 4 +- .../WithSpanSingletons.java | 4 +- .../testing/AgentSpanTestingInstrumenter.java | 4 +- .../play/v2_4/Play24Singletons.java | 2 +- .../play/v2_6/Play26Singletons.java | 2 +- .../PlayWsClientInstrumenterFactory.java | 2 +- .../quartz/v2_0/QuartzTelemetryBuilder.java | 2 +- .../rabbitmq/RabbitSingletons.java | 6 +- .../ratpack/RatpackSingletons.java | 2 +- .../ratpack/RatpackTelemetryBuilder.java | 4 +- .../v1_0/ReactorNettySingletons.java | 2 +- .../rediscala/RediscalaSingletons.java | 2 +- .../redisson/RedissonInstrumenterFactory.java | 2 +- .../restlet/v1_0/RestletTelemetryBuilder.java | 2 +- .../internal/RestletInstrumenterFactory.java | 2 +- .../rmi/client/RmiClientSingletons.java | 2 +- .../rmi/server/RmiServerSingletons.java | 2 +- .../rocketmq/RocketMqInstrumenterFactory.java | 12 +-- .../servlet/ServletInstrumenterBuilder.java | 2 +- .../response/ResponseInstrumenterFactory.java | 2 +- .../spring/batch/chunk/ChunkSingletons.java | 2 +- .../spring/batch/item/ItemSingletons.java | 2 +- .../spring/batch/job/JobSingletons.java | 2 +- .../spring/batch/step/StepSingletons.java | 2 +- .../autoconfigure/aspects/WithSpanAspect.java | 2 +- .../spring/data/SpringDataSingletons.java | 2 +- .../SpringIntegrationTelemetryBuilder.java | 4 +- .../spring/jms/SpringJmsSingletons.java | 2 +- .../spring/rabbit/SpringRabbitSingletons.java | 2 +- .../springrmi/SpringRmiSingletons.java | 4 +- .../SpringSchedulingSingletons.java | 2 +- .../spring/web/SpringWebTelemetryBuilder.java | 2 +- .../webflux/server/WebfluxSingletons.java | 4 +- .../client/SpringWebfluxTelemetryBuilder.java | 2 +- .../springwebmvc/SpringWebMvcSingletons.java | 4 +- .../webmvc/SpringWebMvcTelemetryBuilder.java | 2 +- .../spring/ws/SpringWsSingletons.java | 2 +- .../spymemcached/SpymemcachedSingletons.java | 2 +- .../struts2/StrutsSingletons.java | 2 +- .../tapestry/TapestrySingletons.java | 2 +- .../common/TomcatInstrumenterFactory.java | 2 +- .../twilio/TwilioSingletons.java | 2 +- .../undertow/UndertowSingletons.java | 2 +- .../vaadin/VaadinSingletons.java | 8 +- .../VertxClientInstrumenterFactory.java | 2 +- .../testing/TestInstrumenters.java | 6 +- 120 files changed, 253 insertions(+), 175 deletions(-) diff --git a/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpRouteHolderTest.java b/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpRouteHolderTest.java index 1f8fc4944ffe..a74ad863ce04 100644 --- a/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpRouteHolderTest.java +++ b/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpRouteHolderTest.java @@ -23,7 +23,7 @@ void shouldSetRouteEvenIfSpanIsNotSampled() { Instrumenter instrumenter = Instrumenter.builder(testing.getOpenTelemetry(), "test", s -> s) .addContextCustomizer(HttpRouteHolder.get()) - .newInstrumenter(); + .buildInstrumenter(); Context context = instrumenter.start(Context.root(), "test"); diff --git a/instrumentation-api/src/jmh/java/io/opentelemetry/instrumentation/api/instrumenter/InstrumenterBenchmark.java b/instrumentation-api/src/jmh/java/io/opentelemetry/instrumentation/api/instrumenter/InstrumenterBenchmark.java index 6d06c45b219c..5e2a4726dd4e 100644 --- a/instrumentation-api/src/jmh/java/io/opentelemetry/instrumentation/api/instrumenter/InstrumenterBenchmark.java +++ b/instrumentation-api/src/jmh/java/io/opentelemetry/instrumentation/api/instrumenter/InstrumenterBenchmark.java @@ -45,7 +45,7 @@ public class InstrumenterBenchmark { HttpClientAttributesExtractor.create(ConstantHttpAttributesGetter.INSTANCE)) .addAttributesExtractor( NetServerAttributesExtractor.create(new ConstantNetAttributesGetter())) - .newInstrumenter(); + .buildInstrumenter(); @Benchmark public Context start() { diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/InstrumenterBuilder.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/InstrumenterBuilder.java index 292e8b937b9a..5bdff5a5de40 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/InstrumenterBuilder.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/InstrumenterBuilder.java @@ -183,27 +183,36 @@ public InstrumenterBuilder setEnabled(boolean enabled) { /** * Returns a new {@link Instrumenter} which will create {@linkplain SpanKind#CLIENT client} spans * and inject context into requests. + * + * @deprecated Use {@link #buildClientInstrumenter(TextMapSetter)} instead. */ + @Deprecated public Instrumenter newClientInstrumenter(TextMapSetter setter) { - return newInstrumenter( + return buildInstrumenter( InstrumenterConstructor.propagatingToDownstream(setter), SpanKindExtractor.alwaysClient()); } /** * Returns a new {@link Instrumenter} which will create {@linkplain SpanKind#SERVER server} spans * and extract context from requests. + * + * @deprecated Use {@link #buildServerInstrumenter(TextMapGetter)} instead. */ + @Deprecated public Instrumenter newServerInstrumenter(TextMapGetter getter) { - return newInstrumenter( + return buildInstrumenter( InstrumenterConstructor.propagatingFromUpstream(getter), SpanKindExtractor.alwaysServer()); } /** * Returns a new {@link Instrumenter} which will create {@linkplain SpanKind#PRODUCER producer} * spans and inject context into requests. + * + * @deprecated Use {@link #buildProducerInstrumenter(TextMapSetter)} instead. */ + @Deprecated public Instrumenter newProducerInstrumenter(TextMapSetter setter) { - return newInstrumenter( + return buildInstrumenter( InstrumenterConstructor.propagatingToDownstream(setter), SpanKindExtractor.alwaysProducer()); } @@ -211,9 +220,12 @@ public Instrumenter newProducerInstrumenter(TextMapSetter newConsumerInstrumenter(TextMapGetter getter) { - return newInstrumenter( + return buildInstrumenter( InstrumenterConstructor.propagatingFromUpstream(getter), SpanKindExtractor.alwaysConsumer()); } @@ -221,21 +233,84 @@ public Instrumenter newConsumerInstrumenter(TextMapGetter newInstrumenter() { - return newInstrumenter(InstrumenterConstructor.internal(), SpanKindExtractor.alwaysInternal()); + return buildInstrumenter( + InstrumenterConstructor.internal(), SpanKindExtractor.alwaysInternal()); } /** * Returns a new {@link Instrumenter} which will create spans with kind determined by the passed * {@link SpanKindExtractor} and do no context propagation. + * + * @deprecated Use {@link #buildInstrumenter(SpanKindExtractor)} instead. */ + @Deprecated public Instrumenter newInstrumenter( SpanKindExtractor spanKindExtractor) { - return newInstrumenter(InstrumenterConstructor.internal(), spanKindExtractor); + return buildInstrumenter(InstrumenterConstructor.internal(), spanKindExtractor); + } + + /** + * Returns a new {@link Instrumenter} which will create {@linkplain SpanKind#CLIENT client} spans + * and inject context into requests. + */ + public Instrumenter buildClientInstrumenter(TextMapSetter setter) { + return buildInstrumenter( + InstrumenterConstructor.propagatingToDownstream(setter), SpanKindExtractor.alwaysClient()); + } + + /** + * Returns a new {@link Instrumenter} which will create {@linkplain SpanKind#SERVER server} spans + * and extract context from requests. + */ + public Instrumenter buildServerInstrumenter(TextMapGetter getter) { + return buildInstrumenter( + InstrumenterConstructor.propagatingFromUpstream(getter), SpanKindExtractor.alwaysServer()); + } + + /** + * Returns a new {@link Instrumenter} which will create {@linkplain SpanKind#PRODUCER producer} + * spans and inject context into requests. + */ + public Instrumenter buildProducerInstrumenter(TextMapSetter setter) { + return buildInstrumenter( + InstrumenterConstructor.propagatingToDownstream(setter), + SpanKindExtractor.alwaysProducer()); + } + + /** + * Returns a new {@link Instrumenter} which will create {@linkplain SpanKind#CONSUMER consumer} + * spans and extract context from requests. + */ + public Instrumenter buildConsumerInstrumenter(TextMapGetter getter) { + return buildInstrumenter( + InstrumenterConstructor.propagatingFromUpstream(getter), + SpanKindExtractor.alwaysConsumer()); + } + + /** + * Returns a new {@link Instrumenter} which will create {@linkplain SpanKind#INTERNAL internal} + * spans and do no context propagation. + */ + public Instrumenter buildInstrumenter() { + return buildInstrumenter( + InstrumenterConstructor.internal(), SpanKindExtractor.alwaysInternal()); + } + + /** + * Returns a new {@link Instrumenter} which will create spans with kind determined by the passed + * {@link SpanKindExtractor} and do no context propagation. + */ + public Instrumenter buildInstrumenter( + SpanKindExtractor spanKindExtractor) { + return buildInstrumenter(InstrumenterConstructor.internal(), spanKindExtractor); } - private Instrumenter newInstrumenter( + private Instrumenter buildInstrumenter( InstrumenterConstructor constructor, SpanKindExtractor spanKindExtractor) { this.spanKindExtractor = spanKindExtractor; diff --git a/instrumentation-api/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/InstrumenterTest.java b/instrumentation-api/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/InstrumenterTest.java index b7620a81816c..e072858e5d62 100644 --- a/instrumentation-api/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/InstrumenterTest.java +++ b/instrumentation-api/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/InstrumenterTest.java @@ -156,7 +156,7 @@ void server() { otelTesting.getOpenTelemetry(), "test", unused -> "span") .addAttributesExtractors(new AttributesExtractor1(), new AttributesExtractor2()) .addSpanLinksExtractor(new LinksExtractor()) - .newServerInstrumenter(new MapGetter()); + .buildServerInstrumenter(new MapGetter()); Context context = instrumenter.start(Context.root(), REQUEST); SpanContext spanContext = Span.fromContext(context).getSpanContext(); @@ -196,7 +196,7 @@ void server_error() { Instrumenter., Map>builder( otelTesting.getOpenTelemetry(), "test", unused -> "span") .addAttributesExtractors(new AttributesExtractor1(), new AttributesExtractor2()) - .newServerInstrumenter(new MapGetter()); + .buildServerInstrumenter(new MapGetter()); Context context = instrumenter.start(Context.root(), REQUEST); assertThat(Span.fromContext(context).getSpanContext().isValid()).isTrue(); @@ -217,7 +217,7 @@ void server_parent() { Instrumenter., Map>builder( otelTesting.getOpenTelemetry(), "test", unused -> "span") .addAttributesExtractors(new AttributesExtractor1(), new AttributesExtractor2()) - .newServerInstrumenter(new MapGetter()); + .buildServerInstrumenter(new MapGetter()); Map request = new HashMap<>(REQUEST); W3CTraceContextPropagator.getInstance() @@ -258,7 +258,7 @@ void client() { otelTesting.getOpenTelemetry(), "test", unused -> "span") .addAttributesExtractors(new AttributesExtractor1(), new AttributesExtractor2()) .addSpanLinksExtractor(new LinksExtractor()) - .newClientInstrumenter(Map::put); + .buildClientInstrumenter(Map::put); Map request = new HashMap<>(REQUEST); Context context = instrumenter.start(Context.root(), request); @@ -301,7 +301,7 @@ void client_error() { Instrumenter., Map>builder( otelTesting.getOpenTelemetry(), "test", unused -> "span") .addAttributesExtractors(new AttributesExtractor1(), new AttributesExtractor2()) - .newClientInstrumenter(Map::put); + .buildClientInstrumenter(Map::put); Map request = new HashMap<>(REQUEST); Context context = instrumenter.start(Context.root(), request); @@ -326,7 +326,7 @@ void client_parent() { Instrumenter., Map>builder( otelTesting.getOpenTelemetry(), "test", unused -> "span") .addAttributesExtractors(new AttributesExtractor1(), new AttributesExtractor2()) - .newClientInstrumenter(Map::put); + .buildClientInstrumenter(Map::put); Context parent = Context.root() @@ -383,7 +383,7 @@ public void onEnd(Context context, Attributes endAttributes, long endNanos) { Instrumenter., Map>builder( otelTesting.getOpenTelemetry(), "test", unused -> "span") .addOperationListener(operationListener) - .newServerInstrumenter(new MapGetter()); + .buildServerInstrumenter(new MapGetter()); Context context = instrumenter.start(Context.root(), REQUEST); instrumenter.end(context, REQUEST, RESPONSE, null); @@ -415,7 +415,7 @@ public void onEnd(Context context, Attributes endAttributes, long endNanos) { Instrumenter., Map>builder( otelTesting.getOpenTelemetry(), "test", unused -> "span") .addOperationMetrics(meter -> operationListener) - .newServerInstrumenter(new MapGetter()); + .buildServerInstrumenter(new MapGetter()); Context context = instrumenter.start(Context.root(), REQUEST); instrumenter.end(context, REQUEST, RESPONSE, null); @@ -432,7 +432,7 @@ void shouldNotAddInvalidLink() { otelTesting.getOpenTelemetry(), "test", request -> "test span") .addSpanLinksExtractor( (spanLinks, parentContext, request) -> spanLinks.addLink(SpanContext.getInvalid())) - .newInstrumenter(); + .buildInstrumenter(); // when Context context = instrumenter.start(Context.root(), "request"); @@ -456,7 +456,7 @@ void shouldUseContextCustomizer() { otelTesting.getOpenTelemetry(), "test", request -> "test span") .addContextCustomizer( (context, request, attributes) -> context.with(testKey, "testVal")) - .newInstrumenter(); + .buildInstrumenter(); // when Context context = instrumenter.start(Context.root(), "request"); @@ -471,7 +471,7 @@ void shouldDisableInstrumenter() { Instrumenter.builder( otelTesting.getOpenTelemetry(), "test", request -> "test span") .setEnabled(false) - .newInstrumenter(); + .buildInstrumenter(); assertThat(instrumenter.shouldStart(Context.root(), "request")).isFalse(); } @@ -482,7 +482,8 @@ void instrumentationVersion_default() { Instrumenter.builder( otelTesting.getOpenTelemetry(), "test-instrumentation", name -> "span"); - Instrumenter, Map> instrumenter = builder.newInstrumenter(); + Instrumenter, Map> instrumenter = + builder.buildInstrumenter(); Context context = instrumenter.start(Context.root(), Collections.emptyMap()); assertThat(Span.fromContext(context)).isNotNull(); @@ -507,7 +508,7 @@ void instrumentationVersion_custom() { Instrumenter., Map>builder( otelTesting.getOpenTelemetry(), "test", name -> "span") .setInstrumentationVersion("1.0") - .newInstrumenter(); + .buildInstrumenter(); Context context = instrumenter.start(Context.root(), Collections.emptyMap()); assertThat(Span.fromContext(context)).isNotNull(); @@ -532,7 +533,7 @@ void schemaUrl() { Instrumenter., Map>builder( otelTesting.getOpenTelemetry(), "test", name -> "span") .setSchemaUrl("https://opentelemetry.io/schemas/1.0.0") - .newInstrumenter(); + .buildInstrumenter(); Context context = instrumenter.start(Context.root(), Collections.emptyMap()); assertThat(Span.fromContext(context)).isNotNull(); @@ -564,7 +565,7 @@ void shouldRetrieveSpanKeysFromAttributesExtractors() { mockHttpClientAttributes, mockNetClientAttributes, mockDbClientAttributes) - .newInstrumenter(); + .buildInstrumenter(); Context context = instrumenter.start(Context.root(), REQUEST); diff --git a/instrumentation/akka/akka-http-10.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/akkahttp/client/AkkaHttpClientSingletons.java b/instrumentation/akka/akka-http-10.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/akkahttp/client/AkkaHttpClientSingletons.java index eed5bb75ea41..192c61cbd46d 100644 --- a/instrumentation/akka/akka-http-10.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/akkahttp/client/AkkaHttpClientSingletons.java +++ b/instrumentation/akka/akka-http-10.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/akkahttp/client/AkkaHttpClientSingletons.java @@ -44,7 +44,7 @@ public class AkkaHttpClientSingletons { PeerServiceAttributesExtractor.create( netAttributesGetter, CommonConfig.get().getPeerServiceMapping())) .addOperationMetrics(HttpClientMetrics.get()) - .newInstrumenter(SpanKindExtractor.alwaysClient()); + .buildInstrumenter(SpanKindExtractor.alwaysClient()); } public static Instrumenter instrumenter() { diff --git a/instrumentation/akka/akka-http-10.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/akkahttp/server/AkkaHttpServerSingletons.java b/instrumentation/akka/akka-http-10.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/akkahttp/server/AkkaHttpServerSingletons.java index e3008c629795..76148f9f1987 100644 --- a/instrumentation/akka/akka-http-10.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/akkahttp/server/AkkaHttpServerSingletons.java +++ b/instrumentation/akka/akka-http-10.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/akkahttp/server/AkkaHttpServerSingletons.java @@ -36,7 +36,7 @@ public class AkkaHttpServerSingletons { .build()) .addOperationMetrics(HttpServerMetrics.get()) .addContextCustomizer(HttpRouteHolder.get()) - .newServerInstrumenter(AkkaHttpServerHeaders.INSTANCE); + .buildServerInstrumenter(AkkaHttpServerHeaders.INSTANCE); } public static Instrumenter instrumenter() { diff --git a/instrumentation/apache-camel-2.20/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/apachecamel/CamelSingletons.java b/instrumentation/apache-camel-2.20/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/apachecamel/CamelSingletons.java index b0b7b32673b2..048914ce4644 100644 --- a/instrumentation/apache-camel-2.20/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/apachecamel/CamelSingletons.java +++ b/instrumentation/apache-camel-2.20/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/apachecamel/CamelSingletons.java @@ -74,7 +74,7 @@ public void onEnd( builder.addAttributesExtractor(attributesExtractor); builder.setSpanStatusExtractor(spanStatusExtractor); - INSTRUMENTER = builder.newInstrumenter(request -> request.getSpanKind()); + INSTRUMENTER = builder.buildInstrumenter(request -> request.getSpanKind()); } public static Instrumenter instrumenter() { diff --git a/instrumentation/apache-dubbo-2.7/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/DubboTelemetryBuilder.java b/instrumentation/apache-dubbo-2.7/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/DubboTelemetryBuilder.java index 7875689aaefb..860db6838b44 100644 --- a/instrumentation/apache-dubbo-2.7/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/DubboTelemetryBuilder.java +++ b/instrumentation/apache-dubbo-2.7/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/DubboTelemetryBuilder.java @@ -82,7 +82,7 @@ public DubboTelemetry build() { } return new DubboTelemetry( - serverInstrumenterBuilder.newServerInstrumenter(DubboHeadersGetter.INSTANCE), - clientInstrumenterBuilder.newClientInstrumenter(DubboHeadersSetter.INSTANCE)); + serverInstrumenterBuilder.buildServerInstrumenter(DubboHeadersGetter.INSTANCE), + clientInstrumenterBuilder.buildClientInstrumenter(DubboHeadersSetter.INSTANCE)); } } diff --git a/instrumentation/apache-httpasyncclient-4.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/apachehttpasyncclient/ApacheHttpAsyncClientSingletons.java b/instrumentation/apache-httpasyncclient-4.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/apachehttpasyncclient/ApacheHttpAsyncClientSingletons.java index 6b502c7e2176..c0546d86ded4 100644 --- a/instrumentation/apache-httpasyncclient-4.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/apachehttpasyncclient/ApacheHttpAsyncClientSingletons.java +++ b/instrumentation/apache-httpasyncclient-4.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/apachehttpasyncclient/ApacheHttpAsyncClientSingletons.java @@ -43,7 +43,7 @@ public final class ApacheHttpAsyncClientSingletons { PeerServiceAttributesExtractor.create( netAttributesGetter, CommonConfig.get().getPeerServiceMapping())) .addOperationMetrics(HttpClientMetrics.get()) - .newClientInstrumenter(HttpHeaderSetter.INSTANCE); + .buildClientInstrumenter(HttpHeaderSetter.INSTANCE); } public static Instrumenter instrumenter() { diff --git a/instrumentation/apache-httpclient/apache-httpclient-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/apachehttpclient/v2_0/ApacheHttpClientSingletons.java b/instrumentation/apache-httpclient/apache-httpclient-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/apachehttpclient/v2_0/ApacheHttpClientSingletons.java index e5b77f3db335..354f20b05be5 100644 --- a/instrumentation/apache-httpclient/apache-httpclient-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/apachehttpclient/v2_0/ApacheHttpClientSingletons.java +++ b/instrumentation/apache-httpclient/apache-httpclient-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/apachehttpclient/v2_0/ApacheHttpClientSingletons.java @@ -43,7 +43,7 @@ public final class ApacheHttpClientSingletons { PeerServiceAttributesExtractor.create( netAttributesGetter, CommonConfig.get().getPeerServiceMapping())) .addOperationMetrics(HttpClientMetrics.get()) - .newClientInstrumenter(HttpHeaderSetter.INSTANCE); + .buildClientInstrumenter(HttpHeaderSetter.INSTANCE); } public static Instrumenter instrumenter() { diff --git a/instrumentation/apache-httpclient/apache-httpclient-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/apachehttpclient/v4_0/ApacheHttpClientSingletons.java b/instrumentation/apache-httpclient/apache-httpclient-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/apachehttpclient/v4_0/ApacheHttpClientSingletons.java index 8044030abcb4..40a63825e36d 100644 --- a/instrumentation/apache-httpclient/apache-httpclient-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/apachehttpclient/v4_0/ApacheHttpClientSingletons.java +++ b/instrumentation/apache-httpclient/apache-httpclient-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/apachehttpclient/v4_0/ApacheHttpClientSingletons.java @@ -43,7 +43,7 @@ public final class ApacheHttpClientSingletons { PeerServiceAttributesExtractor.create( netAttributesGetter, CommonConfig.get().getPeerServiceMapping())) .addOperationMetrics(HttpClientMetrics.get()) - .newClientInstrumenter(HttpHeaderSetter.INSTANCE); + .buildClientInstrumenter(HttpHeaderSetter.INSTANCE); } public static Instrumenter instrumenter() { diff --git a/instrumentation/apache-httpclient/apache-httpclient-4.3/library/src/main/java/io/opentelemetry/instrumentation/apachehttpclient/v4_3/ApacheHttpClientTelemetryBuilder.java b/instrumentation/apache-httpclient/apache-httpclient-4.3/library/src/main/java/io/opentelemetry/instrumentation/apachehttpclient/v4_3/ApacheHttpClientTelemetryBuilder.java index 88425f9e26c5..f948e08a6bdc 100644 --- a/instrumentation/apache-httpclient/apache-httpclient-4.3/library/src/main/java/io/opentelemetry/instrumentation/apachehttpclient/v4_3/ApacheHttpClientTelemetryBuilder.java +++ b/instrumentation/apache-httpclient/apache-httpclient-4.3/library/src/main/java/io/opentelemetry/instrumentation/apachehttpclient/v4_3/ApacheHttpClientTelemetryBuilder.java @@ -86,7 +86,7 @@ public ApacheHttpClientTelemetry build() { .addAttributesExtractor(NetClientAttributesExtractor.create(netAttributesGetter)) .addAttributesExtractors(additionalExtractors) // We manually inject because we need to inject internal requests for redirects. - .newInstrumenter(SpanKindExtractor.alwaysClient()); + .buildInstrumenter(SpanKindExtractor.alwaysClient()); return new ApacheHttpClientTelemetry(instrumenter, openTelemetry.getPropagators()); } diff --git a/instrumentation/apache-httpclient/apache-httpclient-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/apachehttpclient/v5_0/ApacheHttpClientSingletons.java b/instrumentation/apache-httpclient/apache-httpclient-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/apachehttpclient/v5_0/ApacheHttpClientSingletons.java index f930b6b932a0..9db9a474a2ec 100644 --- a/instrumentation/apache-httpclient/apache-httpclient-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/apachehttpclient/v5_0/ApacheHttpClientSingletons.java +++ b/instrumentation/apache-httpclient/apache-httpclient-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/apachehttpclient/v5_0/ApacheHttpClientSingletons.java @@ -44,7 +44,7 @@ public final class ApacheHttpClientSingletons { PeerServiceAttributesExtractor.create( netAttributesGetter, CommonConfig.get().getPeerServiceMapping())) .addOperationMetrics(HttpClientMetrics.get()) - .newClientInstrumenter(HttpHeaderSetter.INSTANCE); + .buildClientInstrumenter(HttpHeaderSetter.INSTANCE); } public static Instrumenter instrumenter() { diff --git a/instrumentation/armeria-1.3/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_3/ArmeriaTelemetryBuilder.java b/instrumentation/armeria-1.3/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_3/ArmeriaTelemetryBuilder.java index c7d07816eb49..da0ec0443716 100644 --- a/instrumentation/armeria-1.3/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_3/ArmeriaTelemetryBuilder.java +++ b/instrumentation/armeria-1.3/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_3/ArmeriaTelemetryBuilder.java @@ -186,7 +186,7 @@ public ArmeriaTelemetry build() { } return new ArmeriaTelemetry( - clientInstrumenterBuilder.newClientInstrumenter(ClientRequestContextSetter.INSTANCE), - serverInstrumenterBuilder.newServerInstrumenter(RequestContextGetter.INSTANCE)); + clientInstrumenterBuilder.buildClientInstrumenter(ClientRequestContextSetter.INSTANCE), + serverInstrumenterBuilder.buildServerInstrumenter(RequestContextGetter.INSTANCE)); } } diff --git a/instrumentation/async-http-client/async-http-client-1.9/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/asynchttpclient/v1_9/AsyncHttpClientSingletons.java b/instrumentation/async-http-client/async-http-client-1.9/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/asynchttpclient/v1_9/AsyncHttpClientSingletons.java index ad4cfd87437b..c551b0b7dec3 100644 --- a/instrumentation/async-http-client/async-http-client-1.9/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/asynchttpclient/v1_9/AsyncHttpClientSingletons.java +++ b/instrumentation/async-http-client/async-http-client-1.9/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/asynchttpclient/v1_9/AsyncHttpClientSingletons.java @@ -44,7 +44,7 @@ public final class AsyncHttpClientSingletons { PeerServiceAttributesExtractor.create( netAttributesGetter, CommonConfig.get().getPeerServiceMapping())) .addOperationMetrics(HttpClientMetrics.get()) - .newClientInstrumenter(HttpHeaderSetter.INSTANCE); + .buildClientInstrumenter(HttpHeaderSetter.INSTANCE); } public static Instrumenter instrumenter() { diff --git a/instrumentation/async-http-client/async-http-client-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/asynchttpclient/v2_0/AsyncHttpClientSingletons.java b/instrumentation/async-http-client/async-http-client-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/asynchttpclient/v2_0/AsyncHttpClientSingletons.java index 803ba84038fc..f98039773a31 100644 --- a/instrumentation/async-http-client/async-http-client-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/asynchttpclient/v2_0/AsyncHttpClientSingletons.java +++ b/instrumentation/async-http-client/async-http-client-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/asynchttpclient/v2_0/AsyncHttpClientSingletons.java @@ -44,7 +44,7 @@ public final class AsyncHttpClientSingletons { netAttributeGetter, CommonConfig.get().getPeerServiceMapping())) .addAttributesExtractor(new AsyncHttpClientAdditionalAttributesExtractor()) .addOperationMetrics(HttpClientMetrics.get()) - .newClientInstrumenter(HttpHeaderSetter.INSTANCE); + .buildClientInstrumenter(HttpHeaderSetter.INSTANCE); } public static Instrumenter instrumenter() { diff --git a/instrumentation/aws-lambda/aws-lambda-core-1.0/library/src/main/java/io/opentelemetry/instrumentation/awslambdacore/v1_0/internal/AwsLambdaFunctionInstrumenterFactory.java b/instrumentation/aws-lambda/aws-lambda-core-1.0/library/src/main/java/io/opentelemetry/instrumentation/awslambdacore/v1_0/internal/AwsLambdaFunctionInstrumenterFactory.java index 3a81435de3d5..081e7aff80a5 100644 --- a/instrumentation/aws-lambda/aws-lambda-core-1.0/library/src/main/java/io/opentelemetry/instrumentation/awslambdacore/v1_0/internal/AwsLambdaFunctionInstrumenterFactory.java +++ b/instrumentation/aws-lambda/aws-lambda-core-1.0/library/src/main/java/io/opentelemetry/instrumentation/awslambdacore/v1_0/internal/AwsLambdaFunctionInstrumenterFactory.java @@ -24,7 +24,7 @@ public static AwsLambdaFunctionInstrumenter createInstrumenter(OpenTelemetry ope "io.opentelemetry.aws-lambda-core-1.0", AwsLambdaFunctionInstrumenterFactory::spanName) .addAttributesExtractors(new AwsLambdaFunctionAttributesExtractor()) - .newInstrumenter(SpanKindExtractor.alwaysServer())); + .buildInstrumenter(SpanKindExtractor.alwaysServer())); } private static String spanName(AwsLambdaRequest input) { diff --git a/instrumentation/aws-lambda/aws-lambda-events-2.2/library/src/main/java/io/opentelemetry/instrumentation/awslambdaevents/v2_2/internal/AwsLambdaEventsInstrumenterFactory.java b/instrumentation/aws-lambda/aws-lambda-events-2.2/library/src/main/java/io/opentelemetry/instrumentation/awslambdaevents/v2_2/internal/AwsLambdaEventsInstrumenterFactory.java index 062095fbceac..a069e5092ed2 100644 --- a/instrumentation/aws-lambda/aws-lambda-events-2.2/library/src/main/java/io/opentelemetry/instrumentation/awslambdaevents/v2_2/internal/AwsLambdaEventsInstrumenterFactory.java +++ b/instrumentation/aws-lambda/aws-lambda-events-2.2/library/src/main/java/io/opentelemetry/instrumentation/awslambdaevents/v2_2/internal/AwsLambdaEventsInstrumenterFactory.java @@ -29,7 +29,7 @@ public static AwsLambdaFunctionInstrumenter createInstrumenter(OpenTelemetry ope .addAttributesExtractors( new AwsLambdaFunctionAttributesExtractor(), new ApiGatewayProxyAttributesExtractor()) - .newInstrumenter(SpanKindExtractor.alwaysServer())); + .buildInstrumenter(SpanKindExtractor.alwaysServer())); } private static String spanName(AwsLambdaRequest input) { diff --git a/instrumentation/aws-lambda/aws-lambda-events-2.2/library/src/main/java/io/opentelemetry/instrumentation/awslambdaevents/v2_2/internal/AwsLambdaSqsInstrumenterFactory.java b/instrumentation/aws-lambda/aws-lambda-events-2.2/library/src/main/java/io/opentelemetry/instrumentation/awslambdaevents/v2_2/internal/AwsLambdaSqsInstrumenterFactory.java index 70d7ece91e6c..ffd6518f3ad5 100644 --- a/instrumentation/aws-lambda/aws-lambda-events-2.2/library/src/main/java/io/opentelemetry/instrumentation/awslambdaevents/v2_2/internal/AwsLambdaSqsInstrumenterFactory.java +++ b/instrumentation/aws-lambda/aws-lambda-events-2.2/library/src/main/java/io/opentelemetry/instrumentation/awslambdaevents/v2_2/internal/AwsLambdaSqsInstrumenterFactory.java @@ -24,7 +24,7 @@ public static Instrumenter forEvent(OpenTelemetry openTelemetry) AwsLambdaSqsInstrumenterFactory::spanName) .addAttributesExtractors(new SqsEventAttributesExtractor()) .addSpanLinksExtractor(new SqsEventSpanLinksExtractor()) - .newInstrumenter(SpanKindExtractor.alwaysConsumer()); + .buildInstrumenter(SpanKindExtractor.alwaysConsumer()); } public static Instrumenter forMessage(OpenTelemetry openTelemetry) { @@ -34,7 +34,7 @@ public static Instrumenter forMessage(OpenTelemetry openTeleme message -> message.getEventSource() + " process") .addAttributesExtractors(new SqsMessageAttributesExtractor()) .addSpanLinksExtractor(new SqsMessageSpanLinksExtractor()) - .newInstrumenter(SpanKindExtractor.alwaysConsumer()); + .buildInstrumenter(SpanKindExtractor.alwaysConsumer()); } private static String spanName(SQSEvent event) { diff --git a/instrumentation/aws-sdk/aws-sdk-1.11/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/AwsSdkInstrumenterFactory.java b/instrumentation/aws-sdk/aws-sdk-1.11/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/AwsSdkInstrumenterFactory.java index d6a3ac6b6d39..d2fba68e6ef2 100644 --- a/instrumentation/aws-sdk/aws-sdk-1.11/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/AwsSdkInstrumenterFactory.java +++ b/instrumentation/aws-sdk/aws-sdk-1.11/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/AwsSdkInstrumenterFactory.java @@ -68,7 +68,7 @@ private static Instrumenter, Response> createInstrumenter( captureExperimentalSpanAttributes ? extendedAttributesExtractors : defaultAttributesExtractors) - .newInstrumenter(kindExtractor); + .buildInstrumenter(kindExtractor); } private AwsSdkInstrumenterFactory() {} diff --git a/instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/AwsSdkInstrumenterFactory.java b/instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/AwsSdkInstrumenterFactory.java index 8b06455c3b08..1498a692a717 100644 --- a/instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/AwsSdkInstrumenterFactory.java +++ b/instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/AwsSdkInstrumenterFactory.java @@ -73,7 +73,7 @@ private static Instrumenter createInstrume captureExperimentalSpanAttributes ? extendedAttributesExtractors : defaultAttributesExtractors) - .newInstrumenter(spanKindExtractor); + .buildInstrumenter(spanKindExtractor); } private static String spanName(ExecutionAttributes attributes) { diff --git a/instrumentation/cassandra/cassandra-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/cassandra/v3_0/CassandraSingletons.java b/instrumentation/cassandra/cassandra-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/cassandra/v3_0/CassandraSingletons.java index 24ca24b9c7ad..9b61b45e186a 100644 --- a/instrumentation/cassandra/cassandra-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/cassandra/v3_0/CassandraSingletons.java +++ b/instrumentation/cassandra/cassandra-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/cassandra/v3_0/CassandraSingletons.java @@ -38,7 +38,7 @@ public final class CassandraSingletons { .build()) .addAttributesExtractor( NetClientAttributesExtractor.create(new CassandraNetAttributesGetter())) - .newInstrumenter(SpanKindExtractor.alwaysClient()); + .buildInstrumenter(SpanKindExtractor.alwaysClient()); } public static Instrumenter instrumenter() { diff --git a/instrumentation/cassandra/cassandra-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/cassandra/v4_0/CassandraSingletons.java b/instrumentation/cassandra/cassandra-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/cassandra/v4_0/CassandraSingletons.java index 8e2e692767ec..b84df6935485 100644 --- a/instrumentation/cassandra/cassandra-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/cassandra/v4_0/CassandraSingletons.java +++ b/instrumentation/cassandra/cassandra-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/cassandra/v4_0/CassandraSingletons.java @@ -38,7 +38,7 @@ public final class CassandraSingletons { .addAttributesExtractor( NetClientAttributesExtractor.create(new CassandraNetAttributesGetter())) .addAttributesExtractor(new CassandraAttributesExtractor()) - .newInstrumenter(SpanKindExtractor.alwaysClient()); + .buildInstrumenter(SpanKindExtractor.alwaysClient()); } public static Instrumenter instrumenter() { diff --git a/instrumentation/couchbase/couchbase-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/couchbase/v2_0/CouchbaseSingletons.java b/instrumentation/couchbase/couchbase-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/couchbase/v2_0/CouchbaseSingletons.java index 14ccdb2f5088..ba7aab490529 100644 --- a/instrumentation/couchbase/couchbase-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/couchbase/v2_0/CouchbaseSingletons.java +++ b/instrumentation/couchbase/couchbase-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/couchbase/v2_0/CouchbaseSingletons.java @@ -46,7 +46,7 @@ public final class CouchbaseSingletons { builder.addAttributesExtractor(new ExperimentalAttributesExtractor()); } - INSTRUMENTER = builder.newInstrumenter(SpanKindExtractor.alwaysClient()); + INSTRUMENTER = builder.buildInstrumenter(SpanKindExtractor.alwaysClient()); } public static Instrumenter instrumenter() { diff --git a/instrumentation/dropwizard/dropwizard-views-0.7/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/dropwizardviews/DropwizardSingletons.java b/instrumentation/dropwizard/dropwizard-views-0.7/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/dropwizardviews/DropwizardSingletons.java index c6c4cb954fa3..f9c799c12e65 100644 --- a/instrumentation/dropwizard/dropwizard-views-0.7/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/dropwizardviews/DropwizardSingletons.java +++ b/instrumentation/dropwizard/dropwizard-views-0.7/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/dropwizardviews/DropwizardSingletons.java @@ -18,7 +18,7 @@ public final class DropwizardSingletons { Instrumenter.builder( GlobalOpenTelemetry.get(), INSTRUMENTATION_NAME, DropwizardSingletons::spanName) .setEnabled(ExperimentalConfig.get().controllerTelemetryEnabled()) - .newInstrumenter(); + .buildInstrumenter(); private static String spanName(View view) { return "Render " + view.getTemplateName(); diff --git a/instrumentation/elasticsearch/elasticsearch-rest-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/elasticsearch/rest/ElasticsearchRestInstrumenterFactory.java b/instrumentation/elasticsearch/elasticsearch-rest-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/elasticsearch/rest/ElasticsearchRestInstrumenterFactory.java index abf644455399..1540747586c0 100644 --- a/instrumentation/elasticsearch/elasticsearch-rest-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/elasticsearch/rest/ElasticsearchRestInstrumenterFactory.java +++ b/instrumentation/elasticsearch/elasticsearch-rest-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/elasticsearch/rest/ElasticsearchRestInstrumenterFactory.java @@ -33,7 +33,7 @@ public static Instrumenter create( .addAttributesExtractor( PeerServiceAttributesExtractor.create( netAttributesGetter, CommonConfig.get().getPeerServiceMapping())) - .newInstrumenter(SpanKindExtractor.alwaysClient()); + .buildInstrumenter(SpanKindExtractor.alwaysClient()); } private ElasticsearchRestInstrumenterFactory() {} diff --git a/instrumentation/elasticsearch/elasticsearch-transport-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/elasticsearch/transport/ElasticsearchTransportInstrumenterFactory.java b/instrumentation/elasticsearch/elasticsearch-transport-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/elasticsearch/transport/ElasticsearchTransportInstrumenterFactory.java index 22cfb0e3205f..c552e4d4b35a 100644 --- a/instrumentation/elasticsearch/elasticsearch-transport-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/elasticsearch/transport/ElasticsearchTransportInstrumenterFactory.java +++ b/instrumentation/elasticsearch/elasticsearch-transport-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/elasticsearch/transport/ElasticsearchTransportInstrumenterFactory.java @@ -40,7 +40,7 @@ public static Instrumenter create( instrumenterBuilder.addAttributesExtractor(experimentalAttributesExtractor); } - return instrumenterBuilder.newInstrumenter(SpanKindExtractor.alwaysClient()); + return instrumenterBuilder.buildInstrumenter(SpanKindExtractor.alwaysClient()); } private ElasticsearchTransportInstrumenterFactory() {} diff --git a/instrumentation/external-annotations/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/extannotations/ExternalAnnotationSingletons.java b/instrumentation/external-annotations/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/extannotations/ExternalAnnotationSingletons.java index 8f7d1fd74403..5408169134d9 100644 --- a/instrumentation/external-annotations/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/extannotations/ExternalAnnotationSingletons.java +++ b/instrumentation/external-annotations/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/extannotations/ExternalAnnotationSingletons.java @@ -26,7 +26,7 @@ public final class ExternalAnnotationSingletons { "io.opentelemetry.external-annotations", CodeSpanNameExtractor.create(codeAttributesGetter)) .addAttributesExtractor(CodeAttributesExtractor.create(codeAttributesGetter)) - .newInstrumenter(); + .buildInstrumenter(); } public static Instrumenter instrumenter() { diff --git a/instrumentation/finatra-2.9/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/finatra/FinatraSingletons.java b/instrumentation/finatra-2.9/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/finatra/FinatraSingletons.java index cc06f65fa9fa..378881c7786a 100644 --- a/instrumentation/finatra-2.9/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/finatra/FinatraSingletons.java +++ b/instrumentation/finatra-2.9/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/finatra/FinatraSingletons.java @@ -18,7 +18,7 @@ public final class FinatraSingletons { private static final Instrumenter, Void> INSTRUMENTER = Instrumenter., Void>builder( GlobalOpenTelemetry.get(), "io.opentelemetry.finatra-2.9", ClassNames::simpleName) - .newInstrumenter(); + .buildInstrumenter(); public static Instrumenter, Void> instrumenter() { return INSTRUMENTER; diff --git a/instrumentation/geode-1.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/geode/GeodeSingletons.java b/instrumentation/geode-1.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/geode/GeodeSingletons.java index 40d45fa4b048..15d67bcb9740 100644 --- a/instrumentation/geode-1.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/geode/GeodeSingletons.java +++ b/instrumentation/geode-1.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/geode/GeodeSingletons.java @@ -25,7 +25,7 @@ public final class GeodeSingletons { INSTRUMENTATION_NAME, DbClientSpanNameExtractor.create(dbClientAttributesGetter)) .addAttributesExtractor(DbClientAttributesExtractor.create(dbClientAttributesGetter)) - .newInstrumenter(SpanKindExtractor.alwaysClient()); + .buildInstrumenter(SpanKindExtractor.alwaysClient()); } public static Instrumenter instrumenter() { diff --git a/instrumentation/google-http-client-1.19/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/googlehttpclient/GoogleHttpClientSingletons.java b/instrumentation/google-http-client-1.19/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/googlehttpclient/GoogleHttpClientSingletons.java index ce52d7ea69fe..f286beb4a343 100644 --- a/instrumentation/google-http-client-1.19/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/googlehttpclient/GoogleHttpClientSingletons.java +++ b/instrumentation/google-http-client-1.19/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/googlehttpclient/GoogleHttpClientSingletons.java @@ -44,7 +44,7 @@ public class GoogleHttpClientSingletons { PeerServiceAttributesExtractor.create( netAttributesGetter, CommonConfig.get().getPeerServiceMapping())) .addOperationMetrics(HttpClientMetrics.get()) - .newClientInstrumenter(HttpHeaderSetter.INSTANCE); + .buildClientInstrumenter(HttpHeaderSetter.INSTANCE); } public static Instrumenter instrumenter() { diff --git a/instrumentation/grails-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/grails/GrailsSingletons.java b/instrumentation/grails-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/grails/GrailsSingletons.java index 984f4482079e..240e8d0eb223 100644 --- a/instrumentation/grails-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/grails/GrailsSingletons.java +++ b/instrumentation/grails-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/grails/GrailsSingletons.java @@ -19,7 +19,7 @@ public final class GrailsSingletons { Instrumenter.builder( GlobalOpenTelemetry.get(), INSTRUMENTATION_NAME, HandlerData::spanName) .setEnabled(ExperimentalConfig.get().controllerTelemetryEnabled()) - .newInstrumenter(); + .buildInstrumenter(); } public static Instrumenter instrumenter() { diff --git a/instrumentation/graphql-java-12.0/library/src/main/java/io/opentelemetry/instrumentation/graphql/GraphQLTelemetry.java b/instrumentation/graphql-java-12.0/library/src/main/java/io/opentelemetry/instrumentation/graphql/GraphQLTelemetry.java index b51a07940c76..f16f7ddd10b1 100644 --- a/instrumentation/graphql-java-12.0/library/src/main/java/io/opentelemetry/instrumentation/graphql/GraphQLTelemetry.java +++ b/instrumentation/graphql-java-12.0/library/src/main/java/io/opentelemetry/instrumentation/graphql/GraphQLTelemetry.java @@ -52,7 +52,7 @@ public static GraphQLTelemetryBuilder builder(OpenTelemetry openTelemetry) { }); builder.addAttributesExtractor(new GraphqlAttributesExtractor()); - this.instrumenter = builder.newInstrumenter(); + this.instrumenter = builder.buildInstrumenter(); this.sanitizeQuery = sanitizeQuery; } diff --git a/instrumentation/grizzly-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/grizzly/GrizzlySingletons.java b/instrumentation/grizzly-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/grizzly/GrizzlySingletons.java index 7415e43cec7d..08ba9864b45a 100644 --- a/instrumentation/grizzly-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/grizzly/GrizzlySingletons.java +++ b/instrumentation/grizzly-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/grizzly/GrizzlySingletons.java @@ -48,7 +48,7 @@ public final class GrizzlySingletons { .addContextCustomizer( (context, httpRequestPacket, startAttributes) -> GrizzlyErrorHolder.init(context)) .addContextCustomizer(HttpRouteHolder.get()) - .newServerInstrumenter(HttpRequestHeadersGetter.INSTANCE); + .buildServerInstrumenter(HttpRequestHeadersGetter.INSTANCE); } public static Instrumenter instrumenter() { diff --git a/instrumentation/grpc-1.6/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_6/GrpcTelemetryBuilder.java b/instrumentation/grpc-1.6/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_6/GrpcTelemetryBuilder.java index 025f24ba949b..2041dda88cb4 100644 --- a/instrumentation/grpc-1.6/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_6/GrpcTelemetryBuilder.java +++ b/instrumentation/grpc-1.6/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_6/GrpcTelemetryBuilder.java @@ -155,10 +155,10 @@ public GrpcTelemetry build() { } return new GrpcTelemetry( - serverInstrumenterBuilder.newServerInstrumenter(GrpcRequestGetter.INSTANCE), + serverInstrumenterBuilder.buildServerInstrumenter(GrpcRequestGetter.INSTANCE), // gRPC client interceptors require two phases, one to set up request and one to execute. // So we go ahead and inject manually in this instrumentation. - clientInstrumenterBuilder.newInstrumenter(SpanKindExtractor.alwaysClient()), + clientInstrumenterBuilder.buildInstrumenter(SpanKindExtractor.alwaysClient()), openTelemetry.getPropagators(), captureExperimentalSpanAttributes); } diff --git a/instrumentation/gwt-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/gwt/GwtSingletons.java b/instrumentation/gwt-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/gwt/GwtSingletons.java index 9cd134b226bf..5bfeb789917d 100644 --- a/instrumentation/gwt-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/gwt/GwtSingletons.java +++ b/instrumentation/gwt-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/gwt/GwtSingletons.java @@ -31,7 +31,7 @@ public final class GwtSingletons { .addAttributesExtractor(RpcServerAttributesExtractor.create(rpcAttributesGetter)) // TODO(anuraaga): This should be a server span, but we currently have no way to merge // with the HTTP instrumentation's server span. - .newInstrumenter(); + .buildInstrumenter(); } public static Instrumenter instrumenter() { diff --git a/instrumentation/hibernate/hibernate-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/hibernate/HibernateInstrumenterFactory.java b/instrumentation/hibernate/hibernate-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/hibernate/HibernateInstrumenterFactory.java index cf20a799f4a3..b9aa1c4c4d2d 100644 --- a/instrumentation/hibernate/hibernate-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/hibernate/HibernateInstrumenterFactory.java +++ b/instrumentation/hibernate/hibernate-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/hibernate/HibernateInstrumenterFactory.java @@ -25,7 +25,7 @@ public static Instrumenter createInstrumenter( instrumenterBuilder.addAttributesExtractor(new HibernateExperimentalAttributesExtractor()); } - return instrumenterBuilder.newInstrumenter(); + return instrumenterBuilder.buildInstrumenter(); } private HibernateInstrumenterFactory() {} diff --git a/instrumentation/http-url-connection/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/httpurlconnection/HttpUrlConnectionSingletons.java b/instrumentation/http-url-connection/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/httpurlconnection/HttpUrlConnectionSingletons.java index 11df9f1972d6..8a39cf4bb034 100644 --- a/instrumentation/http-url-connection/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/httpurlconnection/HttpUrlConnectionSingletons.java +++ b/instrumentation/http-url-connection/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/httpurlconnection/HttpUrlConnectionSingletons.java @@ -44,7 +44,7 @@ public final class HttpUrlConnectionSingletons { (context, httpRequestPacket, startAttributes) -> GetOutputStreamContext.init(context)) .addOperationMetrics(HttpClientMetrics.get()) - .newClientInstrumenter(RequestPropertySetter.INSTANCE); + .buildClientInstrumenter(RequestPropertySetter.INSTANCE); } public static Instrumenter instrumenter() { diff --git a/instrumentation/hystrix-1.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/hystrix/HystrixSingletons.java b/instrumentation/hystrix-1.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/hystrix/HystrixSingletons.java index 90346799185f..19848e54d7cc 100644 --- a/instrumentation/hystrix-1.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/hystrix/HystrixSingletons.java +++ b/instrumentation/hystrix-1.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/hystrix/HystrixSingletons.java @@ -26,7 +26,7 @@ public final class HystrixSingletons { builder.addAttributesExtractor(new ExperimentalAttributesExtractor()); } - INSTRUMENTER = builder.newInstrumenter(); + INSTRUMENTER = builder.buildInstrumenter(); } public static Instrumenter instrumenter() { diff --git a/instrumentation/java-http-client/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/httpclient/JdkHttpClientSingletons.java b/instrumentation/java-http-client/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/httpclient/JdkHttpClientSingletons.java index 6de4bbb536d5..a41f415f858e 100644 --- a/instrumentation/java-http-client/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/httpclient/JdkHttpClientSingletons.java +++ b/instrumentation/java-http-client/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/httpclient/JdkHttpClientSingletons.java @@ -44,7 +44,7 @@ public class JdkHttpClientSingletons { PeerServiceAttributesExtractor.create( netAttributesGetter, CommonConfig.get().getPeerServiceMapping())) .addOperationMetrics(HttpClientMetrics.get()) - .newClientInstrumenter(SETTER); + .buildClientInstrumenter(SETTER); } public static Instrumenter> instrumenter() { diff --git a/instrumentation/jaxrs-client/jaxrs-client-1.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jaxrsclient/v1_1/JaxRsClientSingletons.java b/instrumentation/jaxrs-client/jaxrs-client-1.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jaxrsclient/v1_1/JaxRsClientSingletons.java index d409d1f7454a..3edc65ca4711 100644 --- a/instrumentation/jaxrs-client/jaxrs-client-1.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jaxrsclient/v1_1/JaxRsClientSingletons.java +++ b/instrumentation/jaxrs-client/jaxrs-client-1.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jaxrsclient/v1_1/JaxRsClientSingletons.java @@ -42,7 +42,7 @@ public class JaxRsClientSingletons { PeerServiceAttributesExtractor.create( netAttributesGetter, CommonConfig.get().getPeerServiceMapping())) .addOperationMetrics(HttpClientMetrics.get()) - .newClientInstrumenter(ClientRequestHeaderSetter.INSTANCE); + .buildClientInstrumenter(ClientRequestHeaderSetter.INSTANCE); } public static Instrumenter instrumenter() { diff --git a/instrumentation/jaxrs/jaxrs-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jaxrs/v1_0/JaxrsSingletons.java b/instrumentation/jaxrs/jaxrs-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jaxrs/v1_0/JaxrsSingletons.java index 51295ec06426..47461937e44d 100644 --- a/instrumentation/jaxrs/jaxrs-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jaxrs/v1_0/JaxrsSingletons.java +++ b/instrumentation/jaxrs/jaxrs-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jaxrs/v1_0/JaxrsSingletons.java @@ -32,7 +32,7 @@ public final class JaxrsSingletons { CodeSpanNameExtractor.create(codeAttributesGetter)) .addAttributesExtractor(CodeAttributesExtractor.create(codeAttributesGetter)) .setEnabled(ExperimentalConfig.get().controllerTelemetryEnabled()) - .newInstrumenter(); + .buildInstrumenter(); } public static Instrumenter instrumenter() { diff --git a/instrumentation/jaxrs/jaxrs-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jaxrs/JaxrsInstrumenterFactory.java b/instrumentation/jaxrs/jaxrs-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jaxrs/JaxrsInstrumenterFactory.java index d9a243a16e24..9e184160891c 100644 --- a/instrumentation/jaxrs/jaxrs-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jaxrs/JaxrsInstrumenterFactory.java +++ b/instrumentation/jaxrs/jaxrs-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jaxrs/JaxrsInstrumenterFactory.java @@ -22,7 +22,7 @@ public static Instrumenter createInstrumenter(String instrume CodeSpanNameExtractor.create(codeAttributesGetter)) .addAttributesExtractor(CodeAttributesExtractor.create(codeAttributesGetter)) .setEnabled(ExperimentalConfig.get().controllerTelemetryEnabled()) - .newInstrumenter(); + .buildInstrumenter(); } private JaxrsInstrumenterFactory() {} diff --git a/instrumentation/jaxws/jaxws-2.0-axis2-1.6/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/axis2/Axis2Singletons.java b/instrumentation/jaxws/jaxws-2.0-axis2-1.6/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/axis2/Axis2Singletons.java index 2d592512fe77..1ffb4e74b6e1 100644 --- a/instrumentation/jaxws/jaxws-2.0-axis2-1.6/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/axis2/Axis2Singletons.java +++ b/instrumentation/jaxws/jaxws-2.0-axis2-1.6/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/axis2/Axis2Singletons.java @@ -19,7 +19,7 @@ public class Axis2Singletons { Instrumenter.builder( GlobalOpenTelemetry.get(), INSTRUMENTATION_NAME, Axis2Request::spanName) .setEnabled(ExperimentalConfig.get().controllerTelemetryEnabled()) - .newInstrumenter(); + .buildInstrumenter(); } public static Instrumenter instrumenter() { diff --git a/instrumentation/jaxws/jaxws-2.0-cxf-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/cxf/CxfSingletons.java b/instrumentation/jaxws/jaxws-2.0-cxf-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/cxf/CxfSingletons.java index ae2ce18139d8..9da76ff3b41c 100644 --- a/instrumentation/jaxws/jaxws-2.0-cxf-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/cxf/CxfSingletons.java +++ b/instrumentation/jaxws/jaxws-2.0-cxf-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/cxf/CxfSingletons.java @@ -19,7 +19,7 @@ public class CxfSingletons { Instrumenter.builder( GlobalOpenTelemetry.get(), INSTRUMENTATION_NAME, CxfRequest::spanName) .setEnabled(ExperimentalConfig.get().controllerTelemetryEnabled()) - .newInstrumenter(); + .buildInstrumenter(); } public static Instrumenter instrumenter() { diff --git a/instrumentation/jaxws/jaxws-2.0-metro-2.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/metro/MetroSingletons.java b/instrumentation/jaxws/jaxws-2.0-metro-2.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/metro/MetroSingletons.java index b95e2ece6701..470bccf76cc9 100644 --- a/instrumentation/jaxws/jaxws-2.0-metro-2.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/metro/MetroSingletons.java +++ b/instrumentation/jaxws/jaxws-2.0-metro-2.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/metro/MetroSingletons.java @@ -19,7 +19,7 @@ public class MetroSingletons { Instrumenter.builder( GlobalOpenTelemetry.get(), INSTRUMENTATION_NAME, MetroRequest::spanName) .setEnabled(ExperimentalConfig.get().controllerTelemetryEnabled()) - .newInstrumenter(); + .buildInstrumenter(); } public static Instrumenter instrumenter() { diff --git a/instrumentation/jaxws/jaxws-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jaxws/common/JaxWsInstrumenterFactory.java b/instrumentation/jaxws/jaxws-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jaxws/common/JaxWsInstrumenterFactory.java index 2d446b263e6a..b67f6d32d619 100644 --- a/instrumentation/jaxws/jaxws-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jaxws/common/JaxWsInstrumenterFactory.java +++ b/instrumentation/jaxws/jaxws-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jaxws/common/JaxWsInstrumenterFactory.java @@ -22,7 +22,7 @@ public static Instrumenter createInstrumenter(String instrum CodeSpanNameExtractor.create(codeAttributesGetter)) .addAttributesExtractor(CodeAttributesExtractor.create(codeAttributesGetter)) .setEnabled(ExperimentalConfig.get().controllerTelemetryEnabled()) - .newInstrumenter(); + .buildInstrumenter(); } private JaxWsInstrumenterFactory() {} diff --git a/instrumentation/jdbc/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jdbc/JdbcSingletons.java b/instrumentation/jdbc/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jdbc/JdbcSingletons.java index 1aea41cd566e..d1ab54e77442 100644 --- a/instrumentation/jdbc/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jdbc/JdbcSingletons.java +++ b/instrumentation/jdbc/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jdbc/JdbcSingletons.java @@ -40,7 +40,7 @@ public final class JdbcSingletons { .addAttributesExtractor( PeerServiceAttributesExtractor.create( netAttributesGetter, CommonConfig.get().getPeerServiceMapping())) - .newInstrumenter(SpanKindExtractor.alwaysClient()); + .buildInstrumenter(SpanKindExtractor.alwaysClient()); } public static Instrumenter instrumenter() { diff --git a/instrumentation/jdbc/library/src/main/java/io/opentelemetry/instrumentation/jdbc/internal/DataSourceSingletons.java b/instrumentation/jdbc/library/src/main/java/io/opentelemetry/instrumentation/jdbc/internal/DataSourceSingletons.java index 0b48082f84f9..5eed13fb4f62 100644 --- a/instrumentation/jdbc/library/src/main/java/io/opentelemetry/instrumentation/jdbc/internal/DataSourceSingletons.java +++ b/instrumentation/jdbc/library/src/main/java/io/opentelemetry/instrumentation/jdbc/internal/DataSourceSingletons.java @@ -29,7 +29,7 @@ public final class DataSourceSingletons { INSTRUMENTATION_NAME, CodeSpanNameExtractor.create(codeAttributesGetter)) .addAttributesExtractor(CodeAttributesExtractor.create(codeAttributesGetter)) - .newInstrumenter(); + .buildInstrumenter(); } public static Instrumenter instrumenter() { diff --git a/instrumentation/jdbc/library/src/main/java/io/opentelemetry/instrumentation/jdbc/internal/JdbcSingletons.java b/instrumentation/jdbc/library/src/main/java/io/opentelemetry/instrumentation/jdbc/internal/JdbcSingletons.java index 8d6183154fd4..a14214ed35d7 100644 --- a/instrumentation/jdbc/library/src/main/java/io/opentelemetry/instrumentation/jdbc/internal/JdbcSingletons.java +++ b/instrumentation/jdbc/library/src/main/java/io/opentelemetry/instrumentation/jdbc/internal/JdbcSingletons.java @@ -38,7 +38,7 @@ public final class JdbcSingletons { "otel.instrumentation.common.db-statement-sanitizer.enabled", true)) .build()) .addAttributesExtractor(NetClientAttributesExtractor.create(netAttributesGetter)) - .newInstrumenter(SpanKindExtractor.alwaysClient()); + .buildInstrumenter(SpanKindExtractor.alwaysClient()); } public static Instrumenter instrumenter() { diff --git a/instrumentation/jedis/jedis-1.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/v1_4/JedisSingletons.java b/instrumentation/jedis/jedis-1.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/v1_4/JedisSingletons.java index ac7524bb5e0f..3513c86badab 100644 --- a/instrumentation/jedis/jedis-1.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/v1_4/JedisSingletons.java +++ b/instrumentation/jedis/jedis-1.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/v1_4/JedisSingletons.java @@ -33,7 +33,7 @@ public final class JedisSingletons { .addAttributesExtractor( PeerServiceAttributesExtractor.create( netAttributesGetter, CommonConfig.get().getPeerServiceMapping())) - .newInstrumenter(SpanKindExtractor.alwaysClient()); + .buildInstrumenter(SpanKindExtractor.alwaysClient()); } public static Instrumenter instrumenter() { diff --git a/instrumentation/jedis/jedis-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/v3_0/JedisSingletons.java b/instrumentation/jedis/jedis-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/v3_0/JedisSingletons.java index b9ee04584583..0ce4eafe38cb 100644 --- a/instrumentation/jedis/jedis-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/v3_0/JedisSingletons.java +++ b/instrumentation/jedis/jedis-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/v3_0/JedisSingletons.java @@ -33,7 +33,7 @@ public final class JedisSingletons { .addAttributesExtractor( PeerServiceAttributesExtractor.create( netAttributesGetter, CommonConfig.get().getPeerServiceMapping())) - .newInstrumenter(SpanKindExtractor.alwaysClient()); + .buildInstrumenter(SpanKindExtractor.alwaysClient()); } public static Instrumenter instrumenter() { diff --git a/instrumentation/jedis/jedis-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/v4_0/JedisSingletons.java b/instrumentation/jedis/jedis-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/v4_0/JedisSingletons.java index 24cedca4dd86..cf69b2245339 100644 --- a/instrumentation/jedis/jedis-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/v4_0/JedisSingletons.java +++ b/instrumentation/jedis/jedis-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/v4_0/JedisSingletons.java @@ -33,7 +33,7 @@ public final class JedisSingletons { .addAttributesExtractor( PeerServiceAttributesExtractor.create( netAttributesGetter, CommonConfig.get().getPeerServiceMapping())) - .newInstrumenter(SpanKindExtractor.alwaysClient()); + .buildInstrumenter(SpanKindExtractor.alwaysClient()); } public static Instrumenter instrumenter() { diff --git a/instrumentation/jetty-httpclient/jetty-httpclient-9.2/library/src/main/java/io/opentelemetry/instrumentation/jetty/httpclient/v9_2/internal/JettyClientInstrumenterBuilder.java b/instrumentation/jetty-httpclient/jetty-httpclient-9.2/library/src/main/java/io/opentelemetry/instrumentation/jetty/httpclient/v9_2/internal/JettyClientInstrumenterBuilder.java index 0ab53152ec8e..4d2182c29d58 100644 --- a/instrumentation/jetty-httpclient/jetty-httpclient-9.2/library/src/main/java/io/opentelemetry/instrumentation/jetty/httpclient/v9_2/internal/JettyClientInstrumenterBuilder.java +++ b/instrumentation/jetty-httpclient/jetty-httpclient-9.2/library/src/main/java/io/opentelemetry/instrumentation/jetty/httpclient/v9_2/internal/JettyClientInstrumenterBuilder.java @@ -69,6 +69,6 @@ public Instrumenter build() { .addAttributesExtractor(NetClientAttributesExtractor.create(netAttributesGetter)) .addAttributesExtractors(additionalExtractors) .addOperationMetrics(HttpClientMetrics.get()) - .newClientInstrumenter(HttpHeaderSetter.INSTANCE); + .buildClientInstrumenter(HttpHeaderSetter.INSTANCE); } } diff --git a/instrumentation/jms-1.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jms/JmsSingletons.java b/instrumentation/jms-1.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jms/JmsSingletons.java index 859a4d87bd74..b1c5e30c0b0b 100644 --- a/instrumentation/jms-1.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jms/JmsSingletons.java +++ b/instrumentation/jms-1.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jms/JmsSingletons.java @@ -32,7 +32,7 @@ private static Instrumenter buildProducerInstrumen INSTRUMENTATION_NAME, MessagingSpanNameExtractor.create(getter, operation)) .addAttributesExtractor(MessagingAttributesExtractor.create(getter, operation)) - .newProducerInstrumenter(MessagePropertySetter.INSTANCE); + .buildProducerInstrumenter(MessagePropertySetter.INSTANCE); } private static Instrumenter buildConsumerInstrumenter() { @@ -46,7 +46,7 @@ private static Instrumenter buildConsumerInstrumen MessagingSpanNameExtractor.create(getter, operation)) .addAttributesExtractor(MessagingAttributesExtractor.create(getter, operation)) .setEnabled(ExperimentalConfig.get().messagingReceiveInstrumentationEnabled()) - .newInstrumenter(SpanKindExtractor.alwaysConsumer()); + .buildInstrumenter(SpanKindExtractor.alwaysConsumer()); } private static Instrumenter buildListenerInstrumenter() { @@ -58,7 +58,7 @@ private static Instrumenter buildListenerInstrumen INSTRUMENTATION_NAME, MessagingSpanNameExtractor.create(getter, operation)) .addAttributesExtractor(MessagingAttributesExtractor.create(getter, operation)) - .newConsumerInstrumenter(MessagePropertyGetter.INSTANCE); + .buildConsumerInstrumenter(MessagePropertyGetter.INSTANCE); } public static Instrumenter producerInstrumenter() { diff --git a/instrumentation/jsf/jsf-mojarra-1.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/mojarra/MojarraSingletons.java b/instrumentation/jsf/jsf-mojarra-1.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/mojarra/MojarraSingletons.java index 5287962391b3..395e8654cc5c 100644 --- a/instrumentation/jsf/jsf-mojarra-1.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/mojarra/MojarraSingletons.java +++ b/instrumentation/jsf/jsf-mojarra-1.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/mojarra/MojarraSingletons.java @@ -22,7 +22,7 @@ public class MojarraSingletons { GlobalOpenTelemetry.get(), INSTRUMENTATION_NAME, JsfRequest::spanName) .setErrorCauseExtractor(new JsfErrorCauseExtractor()) .setEnabled(ExperimentalConfig.get().controllerTelemetryEnabled()) - .newInstrumenter(); + .buildInstrumenter(); } public static Instrumenter instrumenter() { diff --git a/instrumentation/jsf/jsf-myfaces-1.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/myfaces/MyFacesSingletons.java b/instrumentation/jsf/jsf-myfaces-1.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/myfaces/MyFacesSingletons.java index 36e1b6072029..8da9a51d3880 100644 --- a/instrumentation/jsf/jsf-myfaces-1.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/myfaces/MyFacesSingletons.java +++ b/instrumentation/jsf/jsf-myfaces-1.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/myfaces/MyFacesSingletons.java @@ -21,7 +21,7 @@ public class MyFacesSingletons { GlobalOpenTelemetry.get(), INSTRUMENTATION_NAME, JsfRequest::spanName) .setErrorCauseExtractor(new MyFacesErrorCauseExtractor()) .setEnabled(ExperimentalConfig.get().controllerTelemetryEnabled()) - .newInstrumenter(); + .buildInstrumenter(); } public static Instrumenter instrumenter() { diff --git a/instrumentation/jsp-2.3/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jsp/HttpJspPageInstrumentationSingletons.java b/instrumentation/jsp-2.3/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jsp/HttpJspPageInstrumentationSingletons.java index e3af13282014..301657c1d69a 100644 --- a/instrumentation/jsp-2.3/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jsp/HttpJspPageInstrumentationSingletons.java +++ b/instrumentation/jsp-2.3/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jsp/HttpJspPageInstrumentationSingletons.java @@ -36,7 +36,7 @@ public class HttpJspPageInstrumentationSingletons { "io.opentelemetry.jsp-2.3", HttpJspPageInstrumentationSingletons::spanNameOnRender) .addAttributesExtractor(new RenderAttributesExtractor()) - .newInstrumenter(SpanKindExtractor.alwaysInternal()); + .buildInstrumenter(SpanKindExtractor.alwaysInternal()); } private static String spanNameOnRender(HttpServletRequest req) { diff --git a/instrumentation/jsp-2.3/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jsp/JspCompilationContextInstrumentationSingletons.java b/instrumentation/jsp-2.3/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jsp/JspCompilationContextInstrumentationSingletons.java index 7e3e79b507db..c4c474c725b7 100644 --- a/instrumentation/jsp-2.3/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jsp/JspCompilationContextInstrumentationSingletons.java +++ b/instrumentation/jsp-2.3/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jsp/JspCompilationContextInstrumentationSingletons.java @@ -30,7 +30,7 @@ public class JspCompilationContextInstrumentationSingletons { "io.opentelemetry.jsp-2.3", JspCompilationContextInstrumentationSingletons::spanNameOnCompile) .addAttributesExtractor(new CompilationAttributesExtractor()) - .newInstrumenter(SpanKindExtractor.alwaysInternal()); + .buildInstrumenter(SpanKindExtractor.alwaysInternal()); } public static String spanNameOnCompile(JspCompilationContext jspCompilationContext) { diff --git a/instrumentation/kafka/kafka-clients/kafka-clients-common/library/src/main/java/io/opentelemetry/instrumentation/kafka/internal/KafkaInstrumenterFactory.java b/instrumentation/kafka/kafka-clients/kafka-clients-common/library/src/main/java/io/opentelemetry/instrumentation/kafka/internal/KafkaInstrumenterFactory.java index fe49522e9085..0d8dc1f8d94f 100644 --- a/instrumentation/kafka/kafka-clients/kafka-clients-common/library/src/main/java/io/opentelemetry/instrumentation/kafka/internal/KafkaInstrumenterFactory.java +++ b/instrumentation/kafka/kafka-clients/kafka-clients-common/library/src/main/java/io/opentelemetry/instrumentation/kafka/internal/KafkaInstrumenterFactory.java @@ -78,7 +78,7 @@ public KafkaInstrumenterFactory setMessagingReceiveInstrumentationEnabled( .addAttributesExtractors(extractors) .addAttributesExtractor(new KafkaProducerAdditionalAttributesExtractor()) .setErrorCauseExtractor(errorCauseExtractor) - .newInstrumenter(SpanKindExtractor.alwaysProducer()); + .buildInstrumenter(SpanKindExtractor.alwaysProducer()); } public Instrumenter, Void> createConsumerReceiveInstrumenter() { @@ -92,7 +92,7 @@ public KafkaInstrumenterFactory setMessagingReceiveInstrumentationEnabled( .addAttributesExtractor(MessagingAttributesExtractor.create(getter, operation)) .setErrorCauseExtractor(errorCauseExtractor) .setEnabled(messagingReceiveInstrumentationEnabled) - .newInstrumenter(SpanKindExtractor.alwaysConsumer()); + .buildInstrumenter(SpanKindExtractor.alwaysConsumer()); } public Instrumenter, Void> createConsumerProcessInstrumenter() { @@ -119,15 +119,15 @@ public KafkaInstrumenterFactory setMessagingReceiveInstrumentationEnabled( } if (!propagationEnabled) { - return builder.newInstrumenter(SpanKindExtractor.alwaysConsumer()); + return builder.buildInstrumenter(SpanKindExtractor.alwaysConsumer()); } else if (messagingReceiveInstrumentationEnabled) { builder.addSpanLinksExtractor( SpanLinksExtractor.extractFromRequest( openTelemetry.getPropagators().getTextMapPropagator(), KafkaConsumerRecordGetter.INSTANCE)); - return builder.newInstrumenter(SpanKindExtractor.alwaysConsumer()); + return builder.buildInstrumenter(SpanKindExtractor.alwaysConsumer()); } else { - return builder.newConsumerInstrumenter(KafkaConsumerRecordGetter.INSTANCE); + return builder.buildConsumerInstrumenter(KafkaConsumerRecordGetter.INSTANCE); } } @@ -144,6 +144,6 @@ public KafkaInstrumenterFactory setMessagingReceiveInstrumentationEnabled( new KafkaBatchProcessSpanLinksExtractor( openTelemetry.getPropagators().getTextMapPropagator())) .setErrorCauseExtractor(errorCauseExtractor) - .newInstrumenter(SpanKindExtractor.alwaysConsumer()); + .buildInstrumenter(SpanKindExtractor.alwaysConsumer()); } } diff --git a/instrumentation/ktor/ktor-1.0/library/src/main/kotlin/io/opentelemetry/instrumentation/ktor/v1_0/KtorServerTracing.kt b/instrumentation/ktor/ktor-1.0/library/src/main/kotlin/io/opentelemetry/instrumentation/ktor/v1_0/KtorServerTracing.kt index 36f6947dbf83..4d1eb26c8b9a 100644 --- a/instrumentation/ktor/ktor-1.0/library/src/main/kotlin/io/opentelemetry/instrumentation/ktor/v1_0/KtorServerTracing.kt +++ b/instrumentation/ktor/ktor-1.0/library/src/main/kotlin/io/opentelemetry/instrumentation/ktor/v1_0/KtorServerTracing.kt @@ -109,7 +109,7 @@ class KtorServerTracing private constructor( addContextCustomizer(HttpRouteHolder.get()) } - val instrumenter = instrumenterBuilder.newServerInstrumenter(ApplicationRequestGetter) + val instrumenter = instrumenterBuilder.buildServerInstrumenter(ApplicationRequestGetter) val feature = KtorServerTracing(instrumenter) diff --git a/instrumentation/ktor/ktor-2.0/library/src/main/kotlin/io/opentelemetry/instrumentation/ktor/v2_0/KtorServerTracing.kt b/instrumentation/ktor/ktor-2.0/library/src/main/kotlin/io/opentelemetry/instrumentation/ktor/v2_0/KtorServerTracing.kt index e78d4e1c71ec..cad507fb7791 100644 --- a/instrumentation/ktor/ktor-2.0/library/src/main/kotlin/io/opentelemetry/instrumentation/ktor/v2_0/KtorServerTracing.kt +++ b/instrumentation/ktor/ktor-2.0/library/src/main/kotlin/io/opentelemetry/instrumentation/ktor/v2_0/KtorServerTracing.kt @@ -109,7 +109,7 @@ class KtorServerTracing private constructor( addContextCustomizer(HttpRouteHolder.get()) } - val instrumenter = instrumenterBuilder.newServerInstrumenter(ApplicationRequestGetter) + val instrumenter = instrumenterBuilder.buildServerInstrumenter(ApplicationRequestGetter) val feature = KtorServerTracing(instrumenter) diff --git a/instrumentation/kubernetes-client-7.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/kubernetesclient/KubernetesClientSingletons.java b/instrumentation/kubernetes-client-7.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/kubernetesclient/KubernetesClientSingletons.java index 8a57dc53ef63..6e9c03c33f72 100644 --- a/instrumentation/kubernetes-client-7.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/kubernetesclient/KubernetesClientSingletons.java +++ b/instrumentation/kubernetes-client-7.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/kubernetesclient/KubernetesClientSingletons.java @@ -54,7 +54,7 @@ public class KubernetesClientSingletons { // Initialize with .newInstrumenter(alwaysClient()) instead of .newClientInstrumenter(..) // because Request is immutable so context must be injected manually - INSTRUMENTER = instrumenterBuilder.newInstrumenter(alwaysClient()); + INSTRUMENTER = instrumenterBuilder.buildInstrumenter(alwaysClient()); CONTEXT_PROPAGATORS = GlobalOpenTelemetry.getPropagators(); } diff --git a/instrumentation/lettuce/lettuce-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/lettuce/v4_0/LettuceSingletons.java b/instrumentation/lettuce/lettuce-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/lettuce/v4_0/LettuceSingletons.java index 2a7ea3ba5174..2e76a1276d6b 100644 --- a/instrumentation/lettuce/lettuce-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/lettuce/v4_0/LettuceSingletons.java +++ b/instrumentation/lettuce/lettuce-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/lettuce/v4_0/LettuceSingletons.java @@ -36,7 +36,7 @@ public final class LettuceSingletons { INSTRUMENTATION_NAME, DbClientSpanNameExtractor.create(dbAttributesGetter)) .addAttributesExtractor(DbClientAttributesExtractor.create(dbAttributesGetter)) - .newInstrumenter(SpanKindExtractor.alwaysClient()); + .buildInstrumenter(SpanKindExtractor.alwaysClient()); LettuceConnectNetAttributesGetter netAttributesGetter = new LettuceConnectNetAttributesGetter(); @@ -48,7 +48,7 @@ public final class LettuceSingletons { PeerServiceAttributesExtractor.create( netAttributesGetter, CommonConfig.get().getPeerServiceMapping())) .addAttributesExtractor(new LettuceConnectAttributesExtractor()) - .newInstrumenter(SpanKindExtractor.alwaysClient()); + .buildInstrumenter(SpanKindExtractor.alwaysClient()); } public static Instrumenter, Void> instrumenter() { diff --git a/instrumentation/lettuce/lettuce-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/lettuce/v5_0/LettuceSingletons.java b/instrumentation/lettuce/lettuce-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/lettuce/v5_0/LettuceSingletons.java index 88cde507b378..9fc5745bf471 100644 --- a/instrumentation/lettuce/lettuce-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/lettuce/v5_0/LettuceSingletons.java +++ b/instrumentation/lettuce/lettuce-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/lettuce/v5_0/LettuceSingletons.java @@ -36,7 +36,7 @@ public final class LettuceSingletons { INSTRUMENTATION_NAME, DbClientSpanNameExtractor.create(dbAttributesGetter)) .addAttributesExtractor(DbClientAttributesExtractor.create(dbAttributesGetter)) - .newInstrumenter(SpanKindExtractor.alwaysClient()); + .buildInstrumenter(SpanKindExtractor.alwaysClient()); LettuceConnectNetAttributesGetter connectNetAttributesGetter = new LettuceConnectNetAttributesGetter(); @@ -49,7 +49,7 @@ public final class LettuceSingletons { PeerServiceAttributesExtractor.create( connectNetAttributesGetter, CommonConfig.get().getPeerServiceMapping())) .addAttributesExtractor(new LettuceConnectAttributesExtractor()) - .newInstrumenter(SpanKindExtractor.alwaysClient()); + .buildInstrumenter(SpanKindExtractor.alwaysClient()); } public static Instrumenter, Void> instrumenter() { diff --git a/instrumentation/liberty/liberty-dispatcher/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/liberty/dispatcher/LibertyDispatcherSingletons.java b/instrumentation/liberty/liberty-dispatcher/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/liberty/dispatcher/LibertyDispatcherSingletons.java index 77c6858c19f7..b0dde684646b 100644 --- a/instrumentation/liberty/liberty-dispatcher/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/liberty/dispatcher/LibertyDispatcherSingletons.java +++ b/instrumentation/liberty/liberty-dispatcher/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/liberty/dispatcher/LibertyDispatcherSingletons.java @@ -40,7 +40,7 @@ public final class LibertyDispatcherSingletons { .addAttributesExtractor(NetServerAttributesExtractor.create(netAttributesGetter)) .addContextCustomizer(HttpRouteHolder.get()) .addOperationMetrics(HttpServerMetrics.get()) - .newServerInstrumenter(LibertyDispatcherRequestGetter.INSTANCE); + .buildServerInstrumenter(LibertyDispatcherRequestGetter.INSTANCE); } public static Instrumenter instrumenter() { diff --git a/instrumentation/methods/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/methods/MethodSingletons.java b/instrumentation/methods/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/methods/MethodSingletons.java index 0ea1661eafc2..dfc04b1c55c8 100644 --- a/instrumentation/methods/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/methods/MethodSingletons.java +++ b/instrumentation/methods/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/methods/MethodSingletons.java @@ -23,7 +23,7 @@ public final class MethodSingletons { INSTRUMENTER = Instrumenter.builder( GlobalOpenTelemetry.get(), INSTRUMENTATION_NAME, spanName) - .newInstrumenter(SpanKindExtractor.alwaysInternal()); + .buildInstrumenter(SpanKindExtractor.alwaysInternal()); } public static Instrumenter instrumenter() { diff --git a/instrumentation/mongo/mongo-3.1/library/src/main/java/io/opentelemetry/instrumentation/mongo/v3_1/MongoInstrumenterFactory.java b/instrumentation/mongo/mongo-3.1/library/src/main/java/io/opentelemetry/instrumentation/mongo/v3_1/MongoInstrumenterFactory.java index 47f758ea1a14..389ab148ecee 100644 --- a/instrumentation/mongo/mongo-3.1/library/src/main/java/io/opentelemetry/instrumentation/mongo/v3_1/MongoInstrumenterFactory.java +++ b/instrumentation/mongo/mongo-3.1/library/src/main/java/io/opentelemetry/instrumentation/mongo/v3_1/MongoInstrumenterFactory.java @@ -33,6 +33,6 @@ static Instrumenter createInstrumenter( .addAttributesExtractor(DbClientAttributesExtractor.create(dbAttributesGetter)) .addAttributesExtractor(netAttributesExtractor) .addAttributesExtractor(attributesExtractor) - .newInstrumenter(SpanKindExtractor.alwaysClient()); + .buildInstrumenter(SpanKindExtractor.alwaysClient()); } } diff --git a/instrumentation/netty/netty-3.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/netty/v3_8/client/NettyClientSingletons.java b/instrumentation/netty/netty-3.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/netty/v3_8/client/NettyClientSingletons.java index c59775b1d040..c700fc7e6fdf 100644 --- a/instrumentation/netty/netty-3.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/netty/v3_8/client/NettyClientSingletons.java +++ b/instrumentation/netty/netty-3.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/netty/v3_8/client/NettyClientSingletons.java @@ -52,7 +52,7 @@ public final class NettyClientSingletons { .addOperationMetrics(HttpClientMetrics.get()) .addContextCustomizer( (context, requestAndChannel, startAttributes) -> NettyErrorHolder.init(context)) - .newClientInstrumenter(HttpRequestHeadersSetter.INSTANCE); + .buildClientInstrumenter(HttpRequestHeadersSetter.INSTANCE); NettyConnectNetAttributesGetter nettyConnectAttributesGetter = new NettyConnectNetAttributesGetter(); @@ -66,7 +66,7 @@ public final class NettyClientSingletons { .addAttributesExtractor( PeerServiceAttributesExtractor.create( nettyConnectAttributesGetter, CommonConfig.get().getPeerServiceMapping())) - .newInstrumenter(SpanKindExtractor.alwaysClient()); + .buildInstrumenter(SpanKindExtractor.alwaysClient()); } public static Instrumenter instrumenter() { diff --git a/instrumentation/netty/netty-3.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/netty/v3_8/server/NettyServerSingletons.java b/instrumentation/netty/netty-3.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/netty/v3_8/server/NettyServerSingletons.java index 77d477b7969d..f4594953f851 100644 --- a/instrumentation/netty/netty-3.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/netty/v3_8/server/NettyServerSingletons.java +++ b/instrumentation/netty/netty-3.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/netty/v3_8/server/NettyServerSingletons.java @@ -43,7 +43,7 @@ final class NettyServerSingletons { .addContextCustomizer( (context, requestAndChannel, startAttributes) -> NettyErrorHolder.init(context)) .addContextCustomizer(HttpRouteHolder.get()) - .newServerInstrumenter(NettyHeadersGetter.INSTANCE); + .buildServerInstrumenter(NettyHeadersGetter.INSTANCE); } public static Instrumenter instrumenter() { diff --git a/instrumentation/netty/netty-4-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/netty/v4/common/client/NettyClientInstrumenterFactory.java b/instrumentation/netty/netty-4-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/netty/v4/common/client/NettyClientInstrumenterFactory.java index f3a0566a6682..309b6d7ba805 100644 --- a/instrumentation/netty/netty-4-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/netty/v4/common/client/NettyClientInstrumenterFactory.java +++ b/instrumentation/netty/netty-4-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/netty/v4/common/client/NettyClientInstrumenterFactory.java @@ -55,7 +55,7 @@ public Instrumenter createHttpInstrumenter( PeerServiceAttributesExtractor.create( netAttributesGetter, CommonConfig.get().getPeerServiceMapping())) .addOperationMetrics(HttpClientMetrics.get()) - .newClientInstrumenter(HttpRequestHeadersSetter.INSTANCE); + .buildClientInstrumenter(HttpRequestHeadersSetter.INSTANCE); } public NettyConnectionInstrumenter createConnectionInstrumenter() { @@ -80,7 +80,7 @@ public NettyConnectionInstrumenter createConnectionInstrumenter() { } Instrumenter instrumenter = - instrumenterBuilder.newInstrumenter( + instrumenterBuilder.buildInstrumenter( connectionTelemetryEnabled ? SpanKindExtractor.alwaysInternal() : SpanKindExtractor.alwaysClient()); @@ -99,7 +99,7 @@ public NettySslInstrumenter createSslInstrumenter() { .addAttributesExtractor( PeerServiceAttributesExtractor.create( netAttributesGetter, CommonConfig.get().getPeerServiceMapping())) - .newInstrumenter( + .buildInstrumenter( sslTelemetryEnabled ? SpanKindExtractor.alwaysInternal() : SpanKindExtractor.alwaysClient()); diff --git a/instrumentation/netty/netty-4-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/netty/v4/common/server/NettyServerInstrumenterFactory.java b/instrumentation/netty/netty-4-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/netty/v4/common/server/NettyServerInstrumenterFactory.java index 99620e026ff9..edfbeaab89f5 100644 --- a/instrumentation/netty/netty-4-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/netty/v4/common/server/NettyServerInstrumenterFactory.java +++ b/instrumentation/netty/netty-4-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/netty/v4/common/server/NettyServerInstrumenterFactory.java @@ -40,7 +40,7 @@ public static Instrumenter create( .addOperationMetrics(HttpServerMetrics.get()) .addContextCustomizer((context, request, attributes) -> NettyErrorHolder.init(context)) .addContextCustomizer(HttpRouteHolder.get()) - .newServerInstrumenter(HttpRequestHeadersGetter.INSTANCE); + .buildServerInstrumenter(HttpRequestHeadersGetter.INSTANCE); } private NettyServerInstrumenterFactory() {} diff --git a/instrumentation/okhttp/okhttp-2.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/okhttp/v2_2/OkHttp2Singletons.java b/instrumentation/okhttp/okhttp-2.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/okhttp/v2_2/OkHttp2Singletons.java index ddc9d0885b24..62a3ae3602f5 100644 --- a/instrumentation/okhttp/okhttp-2.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/okhttp/v2_2/OkHttp2Singletons.java +++ b/instrumentation/okhttp/okhttp-2.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/okhttp/v2_2/OkHttp2Singletons.java @@ -49,7 +49,7 @@ public final class OkHttp2Singletons { PeerServiceAttributesExtractor.create( netClientAttributesGetter, CommonConfig.get().getPeerServiceMapping())) .addOperationMetrics(HttpClientMetrics.get()) - .newInstrumenter(alwaysClient()); + .buildInstrumenter(alwaysClient()); TRACING_INTERCEPTOR = new TracingInterceptor(INSTRUMENTER, openTelemetry.getPropagators()); } diff --git a/instrumentation/okhttp/okhttp-3.0/library/src/main/java/io/opentelemetry/instrumentation/okhttp/v3_0/OkHttpTelemetryBuilder.java b/instrumentation/okhttp/okhttp-3.0/library/src/main/java/io/opentelemetry/instrumentation/okhttp/v3_0/OkHttpTelemetryBuilder.java index 73a856ae9c7d..ba094e4c0b9a 100644 --- a/instrumentation/okhttp/okhttp-3.0/library/src/main/java/io/opentelemetry/instrumentation/okhttp/v3_0/OkHttpTelemetryBuilder.java +++ b/instrumentation/okhttp/okhttp-3.0/library/src/main/java/io/opentelemetry/instrumentation/okhttp/v3_0/OkHttpTelemetryBuilder.java @@ -84,7 +84,7 @@ public OkHttpTelemetry build() { .addAttributesExtractor(NetClientAttributesExtractor.create(attributesGetter)) .addAttributesExtractors(additionalExtractors) .addOperationMetrics(HttpClientMetrics.get()) - .newInstrumenter(alwaysClient()); + .buildInstrumenter(alwaysClient()); return new OkHttpTelemetry(instrumenter, openTelemetry.getPropagators()); } } diff --git a/instrumentation/opentelemetry-extension-annotations-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/extensionannotations/WithSpanSingletons.java b/instrumentation/opentelemetry-extension-annotations-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/extensionannotations/WithSpanSingletons.java index 2f585ee945f2..10e712bc96ff 100644 --- a/instrumentation/opentelemetry-extension-annotations-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/extensionannotations/WithSpanSingletons.java +++ b/instrumentation/opentelemetry-extension-annotations-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/extensionannotations/WithSpanSingletons.java @@ -36,7 +36,7 @@ public static Instrumenter instrumenterWithAttributes() { private static Instrumenter createInstrumenter() { return Instrumenter.builder( GlobalOpenTelemetry.get(), INSTRUMENTATION_NAME, WithSpanSingletons::spanNameFromMethod) - .newInstrumenter(WithSpanSingletons::spanKindFromMethod); + .buildInstrumenter(WithSpanSingletons::spanKindFromMethod); } private static Instrumenter createInstrumenterWithAttributes() { @@ -49,7 +49,7 @@ private static Instrumenter createInstrumenterWithAttribu MethodRequest::method, WithSpanParameterAttributeNamesExtractor.INSTANCE, MethodRequest::args)) - .newInstrumenter(WithSpanSingletons::spanKindFromMethodRequest); + .buildInstrumenter(WithSpanSingletons::spanKindFromMethodRequest); } private static SpanKind spanKindFromMethodRequest(MethodRequest request) { diff --git a/instrumentation/opentelemetry-instrumentation-annotations-1.16/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/instrumentationannotations/WithSpanSingletons.java b/instrumentation/opentelemetry-instrumentation-annotations-1.16/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/instrumentationannotations/WithSpanSingletons.java index e78e30d316c9..a5f8b5540c59 100644 --- a/instrumentation/opentelemetry-instrumentation-annotations-1.16/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/instrumentationannotations/WithSpanSingletons.java +++ b/instrumentation/opentelemetry-instrumentation-annotations-1.16/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/instrumentationannotations/WithSpanSingletons.java @@ -36,7 +36,7 @@ public static Instrumenter instrumenterWithAttributes() { private static Instrumenter createInstrumenter() { return Instrumenter.builder( GlobalOpenTelemetry.get(), INSTRUMENTATION_NAME, WithSpanSingletons::spanNameFromMethod) - .newInstrumenter(WithSpanSingletons::spanKindFromMethod); + .buildInstrumenter(WithSpanSingletons::spanKindFromMethod); } private static Instrumenter createInstrumenterWithAttributes() { @@ -49,7 +49,7 @@ private static Instrumenter createInstrumenterWithAttribu MethodRequest::method, WithSpanParameterAttributeNamesExtractor.INSTANCE, MethodRequest::args)) - .newInstrumenter(WithSpanSingletons::spanKindFromMethodRequest); + .buildInstrumenter(WithSpanSingletons::spanKindFromMethodRequest); } private static SpanKind spanKindFromMethodRequest(MethodRequest request) { diff --git a/instrumentation/opentelemetry-instrumentation-api/testing/src/main/java/io/opentelemetry/javaagent/instrumentation/testing/AgentSpanTestingInstrumenter.java b/instrumentation/opentelemetry-instrumentation-api/testing/src/main/java/io/opentelemetry/javaagent/instrumentation/testing/AgentSpanTestingInstrumenter.java index de40027e3963..8eb1f9d60a04 100644 --- a/instrumentation/opentelemetry-instrumentation-api/testing/src/main/java/io/opentelemetry/javaagent/instrumentation/testing/AgentSpanTestingInstrumenter.java +++ b/instrumentation/opentelemetry-instrumentation-api/testing/src/main/java/io/opentelemetry/javaagent/instrumentation/testing/AgentSpanTestingInstrumenter.java @@ -25,7 +25,7 @@ public final class AgentSpanTestingInstrumenter { Instrumenter.builder(GlobalOpenTelemetry.get(), "test", request -> request) .addContextCustomizer( (context, request, startAttributes) -> context.with(REQUEST_CONTEXT_KEY, request)) - .newInstrumenter(SpanKindExtractor.alwaysInternal()); + .buildInstrumenter(SpanKindExtractor.alwaysInternal()); private static final Instrumenter HTTP_SERVER_INSTRUMENTER = Instrumenter.builder(GlobalOpenTelemetry.get(), "test", request -> request) @@ -34,7 +34,7 @@ public final class AgentSpanTestingInstrumenter { .addContextCustomizer(HttpRouteHolder.get()) .addContextCustomizer( (context, request, startAttributes) -> context.with(REQUEST_CONTEXT_KEY, request)) - .newInstrumenter(SpanKindExtractor.alwaysServer()); + .buildInstrumenter(SpanKindExtractor.alwaysServer()); public static Context startHttpServerSpan(String name) { Context context = HTTP_SERVER_INSTRUMENTER.start(Context.current(), name); diff --git a/instrumentation/play/play-mvc/play-mvc-2.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/play/v2_4/Play24Singletons.java b/instrumentation/play/play-mvc/play-mvc-2.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/play/v2_4/Play24Singletons.java index cd44112d410c..43e221afc7f8 100644 --- a/instrumentation/play/play-mvc/play-mvc-2.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/play/v2_4/Play24Singletons.java +++ b/instrumentation/play/play-mvc/play-mvc-2.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/play/v2_4/Play24Singletons.java @@ -19,7 +19,7 @@ public final class Play24Singletons { private static final Instrumenter INSTRUMENTER = Instrumenter.builder( GlobalOpenTelemetry.get(), "io.opentelemetry.play-mvc-2.4", s -> SPAN_NAME) - .newInstrumenter(); + .buildInstrumenter(); public static Instrumenter instrumenter() { return INSTRUMENTER; diff --git a/instrumentation/play/play-mvc/play-mvc-2.6/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/play/v2_6/Play26Singletons.java b/instrumentation/play/play-mvc/play-mvc-2.6/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/play/v2_6/Play26Singletons.java index f6931dd9c89d..fc1f694a6962 100644 --- a/instrumentation/play/play-mvc/play-mvc-2.6/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/play/v2_6/Play26Singletons.java +++ b/instrumentation/play/play-mvc/play-mvc-2.6/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/play/v2_6/Play26Singletons.java @@ -25,7 +25,7 @@ public final class Play26Singletons { private static final Instrumenter INSTRUMENTER = Instrumenter.builder( GlobalOpenTelemetry.get(), "io.opentelemetry.play-mvc-2.6", s -> SPAN_NAME) - .newInstrumenter(); + .buildInstrumenter(); @Nullable private static final Method typedKeyGetUnderlying; diff --git a/instrumentation/play/play-ws/play-ws-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/playws/PlayWsClientInstrumenterFactory.java b/instrumentation/play/play-ws/play-ws-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/playws/PlayWsClientInstrumenterFactory.java index d3b2aae85c89..233bf344b442 100644 --- a/instrumentation/play/play-ws/play-ws-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/playws/PlayWsClientInstrumenterFactory.java +++ b/instrumentation/play/play-ws/play-ws-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/playws/PlayWsClientInstrumenterFactory.java @@ -38,7 +38,7 @@ public static Instrumenter createInstrumenter(String instrume PeerServiceAttributesExtractor.create( netAttributesGetter, CommonConfig.get().getPeerServiceMapping())) .addOperationMetrics(HttpClientMetrics.get()) - .newClientInstrumenter(HttpHeaderSetter.INSTANCE); + .buildClientInstrumenter(HttpHeaderSetter.INSTANCE); } private PlayWsClientInstrumenterFactory() {} diff --git a/instrumentation/quartz-2.0/library/src/main/java/io/opentelemetry/instrumentation/quartz/v2_0/QuartzTelemetryBuilder.java b/instrumentation/quartz-2.0/library/src/main/java/io/opentelemetry/instrumentation/quartz/v2_0/QuartzTelemetryBuilder.java index aa471f968737..af84f746cfd9 100644 --- a/instrumentation/quartz-2.0/library/src/main/java/io/opentelemetry/instrumentation/quartz/v2_0/QuartzTelemetryBuilder.java +++ b/instrumentation/quartz-2.0/library/src/main/java/io/opentelemetry/instrumentation/quartz/v2_0/QuartzTelemetryBuilder.java @@ -50,6 +50,6 @@ public QuartzTelemetry build() { CodeAttributesExtractor.create(new QuartzCodeAttributesGetter())); instrumenter.addAttributesExtractors(additionalExtractors); - return new QuartzTelemetry(new TracingJobListener(instrumenter.newInstrumenter())); + return new QuartzTelemetry(new TracingJobListener(instrumenter.buildInstrumenter())); } } diff --git a/instrumentation/rabbitmq-2.7/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rabbitmq/RabbitSingletons.java b/instrumentation/rabbitmq-2.7/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rabbitmq/RabbitSingletons.java index a189d641c718..b223d9b74df6 100644 --- a/instrumentation/rabbitmq-2.7/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rabbitmq/RabbitSingletons.java +++ b/instrumentation/rabbitmq-2.7/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rabbitmq/RabbitSingletons.java @@ -55,7 +55,7 @@ private static Instrumenter createChannelInstrumenter() RabbitChannelAttributesGetter.INSTANCE, MessageOperation.SEND)) .addAttributesExtractor( NetClientAttributesExtractor.create(new RabbitChannelNetAttributesGetter())) - .newInstrumenter( + .buildInstrumenter( channelAndMethod -> channelAndMethod.getMethod().equals("Channel.basicPublish") ? PRODUCER : CLIENT); } @@ -73,7 +73,7 @@ private static Instrumenter createReceiveInstrument return Instrumenter.builder( GlobalOpenTelemetry.get(), instrumentationName, ReceiveRequest::spanName) .addAttributesExtractors(extractors) - .newInstrumenter(SpanKindExtractor.alwaysClient()); + .buildInstrumenter(SpanKindExtractor.alwaysClient()); } private static Instrumenter createDeliverInstrumenter() { @@ -89,6 +89,6 @@ private static Instrumenter createDeliverInstrumenter() { return Instrumenter.builder( GlobalOpenTelemetry.get(), instrumentationName, DeliveryRequest::spanName) .addAttributesExtractors(extractors) - .newConsumerInstrumenter(DeliveryRequestGetter.INSTANCE); + .buildConsumerInstrumenter(DeliveryRequestGetter.INSTANCE); } } diff --git a/instrumentation/ratpack/ratpack-1.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/ratpack/RatpackSingletons.java b/instrumentation/ratpack/ratpack-1.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/ratpack/RatpackSingletons.java index e037c3152b20..9f3ac15a5e73 100644 --- a/instrumentation/ratpack/ratpack-1.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/ratpack/RatpackSingletons.java +++ b/instrumentation/ratpack/ratpack-1.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/ratpack/RatpackSingletons.java @@ -19,7 +19,7 @@ public final class RatpackSingletons { private static final Instrumenter INSTRUMENTER = Instrumenter.builder( GlobalOpenTelemetry.get(), "io.opentelemetry.ratpack-1.4", s -> s) - .newInstrumenter(); + .buildInstrumenter(); public static Instrumenter instrumenter() { return INSTRUMENTER; diff --git a/instrumentation/ratpack/ratpack-1.7/library/src/main/java/io/opentelemetry/instrumentation/ratpack/RatpackTelemetryBuilder.java b/instrumentation/ratpack/ratpack-1.7/library/src/main/java/io/opentelemetry/instrumentation/ratpack/RatpackTelemetryBuilder.java index 8850b4f61b0e..77fe4a36ce44 100644 --- a/instrumentation/ratpack/ratpack-1.7/library/src/main/java/io/opentelemetry/instrumentation/ratpack/RatpackTelemetryBuilder.java +++ b/instrumentation/ratpack/ratpack-1.7/library/src/main/java/io/opentelemetry/instrumentation/ratpack/RatpackTelemetryBuilder.java @@ -118,7 +118,7 @@ public RatpackTelemetry build() { .addAttributesExtractor(httpServerAttributesExtractorBuilder.build()) .addAttributesExtractors(additionalExtractors) .addOperationMetrics(HttpServerMetrics.get()) - .newServerInstrumenter(RatpackGetter.INSTANCE); + .buildServerInstrumenter(RatpackGetter.INSTANCE); return new RatpackTelemetry(instrumenter, httpClientInstrumenter()); } @@ -134,6 +134,6 @@ private Instrumenter httpClientInstrumenter() { .addAttributesExtractor(httpClientAttributesExtractorBuilder.build()) .addAttributesExtractors(additionalHttpClientExtractors) .addOperationMetrics(HttpServerMetrics.get()) - .newClientInstrumenter(RequestHeaderSetter.INSTANCE); + .buildClientInstrumenter(RequestHeaderSetter.INSTANCE); } } diff --git a/instrumentation/reactor/reactor-netty/reactor-netty-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/reactornetty/v1_0/ReactorNettySingletons.java b/instrumentation/reactor/reactor-netty/reactor-netty-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/reactornetty/v1_0/ReactorNettySingletons.java index 485e45286096..b181026a7abe 100644 --- a/instrumentation/reactor/reactor-netty/reactor-netty-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/reactornetty/v1_0/ReactorNettySingletons.java +++ b/instrumentation/reactor/reactor-netty/reactor-netty-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/reactornetty/v1_0/ReactorNettySingletons.java @@ -68,7 +68,7 @@ public final class ReactorNettySingletons { netAttributesGetter, CommonConfig.get().getPeerServiceMapping())) .addOperationMetrics(HttpClientMetrics.get()) // headers are injected in ResponseReceiverInstrumenter - .newInstrumenter(SpanKindExtractor.alwaysClient()); + .buildInstrumenter(SpanKindExtractor.alwaysClient()); NettyClientInstrumenterFactory instrumenterFactory = new NettyClientInstrumenterFactory(INSTRUMENTATION_NAME, connectionTelemetryEnabled, false); diff --git a/instrumentation/rediscala-1.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rediscala/RediscalaSingletons.java b/instrumentation/rediscala-1.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rediscala/RediscalaSingletons.java index ca0365de176b..fa92b17a2633 100644 --- a/instrumentation/rediscala-1.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rediscala/RediscalaSingletons.java +++ b/instrumentation/rediscala-1.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rediscala/RediscalaSingletons.java @@ -27,7 +27,7 @@ public final class RediscalaSingletons { INSTRUMENTATION_NAME, DbClientSpanNameExtractor.create(dbAttributesGetter)) .addAttributesExtractor(DbClientAttributesExtractor.create(dbAttributesGetter)) - .newInstrumenter(SpanKindExtractor.alwaysClient()); + .buildInstrumenter(SpanKindExtractor.alwaysClient()); } public static Instrumenter, Void> instrumenter() { diff --git a/instrumentation/redisson/redisson-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/redisson/RedissonInstrumenterFactory.java b/instrumentation/redisson/redisson-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/redisson/RedissonInstrumenterFactory.java index 0d105692a04f..745d55e72659 100644 --- a/instrumentation/redisson/redisson-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/redisson/RedissonInstrumenterFactory.java +++ b/instrumentation/redisson/redisson-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/redisson/RedissonInstrumenterFactory.java @@ -24,7 +24,7 @@ public static Instrumenter createInstrumenter(String inst DbClientSpanNameExtractor.create(dbAttributesGetter)) .addAttributesExtractor(DbClientAttributesExtractor.create(dbAttributesGetter)) .addAttributesExtractor(NetClientAttributesExtractor.create(netAttributesGetter)) - .newInstrumenter(SpanKindExtractor.alwaysClient()); + .buildInstrumenter(SpanKindExtractor.alwaysClient()); } private RedissonInstrumenterFactory() {} diff --git a/instrumentation/restlet/restlet-1.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v1_0/RestletTelemetryBuilder.java b/instrumentation/restlet/restlet-1.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v1_0/RestletTelemetryBuilder.java index 856db04f9768..d013fbf08ac4 100644 --- a/instrumentation/restlet/restlet-1.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v1_0/RestletTelemetryBuilder.java +++ b/instrumentation/restlet/restlet-1.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v1_0/RestletTelemetryBuilder.java @@ -83,7 +83,7 @@ public RestletTelemetry build() { .addAttributesExtractor(NetServerAttributesExtractor.create(netAttributesGetter)) .addAttributesExtractors(additionalExtractors) .addOperationMetrics(HttpServerMetrics.get()) - .newServerInstrumenter(RestletHeadersGetter.INSTANCE); + .buildServerInstrumenter(RestletHeadersGetter.INSTANCE); return new RestletTelemetry(instrumenter); } diff --git a/instrumentation/restlet/restlet-2.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v2_0/internal/RestletInstrumenterFactory.java b/instrumentation/restlet/restlet-2.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v2_0/internal/RestletInstrumenterFactory.java index 5bfe4455339d..8833a83b06cb 100644 --- a/instrumentation/restlet/restlet-2.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v2_0/internal/RestletInstrumenterFactory.java +++ b/instrumentation/restlet/restlet-2.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v2_0/internal/RestletInstrumenterFactory.java @@ -40,6 +40,6 @@ public static Instrumenter newServerInstrumenter( .addAttributesExtractor(NetServerAttributesExtractor.create(netAttributesGetter)) .addAttributesExtractors(additionalExtractors) .addOperationMetrics(HttpServerMetrics.get()) - .newServerInstrumenter(new RestletHeadersGetter()); + .buildServerInstrumenter(new RestletHeadersGetter()); } } diff --git a/instrumentation/rmi/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rmi/client/RmiClientSingletons.java b/instrumentation/rmi/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rmi/client/RmiClientSingletons.java index 8a5985fe3486..678f17611b3b 100644 --- a/instrumentation/rmi/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rmi/client/RmiClientSingletons.java +++ b/instrumentation/rmi/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rmi/client/RmiClientSingletons.java @@ -25,7 +25,7 @@ public final class RmiClientSingletons { "io.opentelemetry.rmi", RpcSpanNameExtractor.create(rpcAttributesGetter)) .addAttributesExtractor(RpcClientAttributesExtractor.create(rpcAttributesGetter)) - .newInstrumenter(SpanKindExtractor.alwaysClient()); + .buildInstrumenter(SpanKindExtractor.alwaysClient()); } public static Instrumenter instrumenter() { diff --git a/instrumentation/rmi/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rmi/server/RmiServerSingletons.java b/instrumentation/rmi/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rmi/server/RmiServerSingletons.java index 7d5944cda812..a12e4b71f123 100644 --- a/instrumentation/rmi/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rmi/server/RmiServerSingletons.java +++ b/instrumentation/rmi/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rmi/server/RmiServerSingletons.java @@ -25,7 +25,7 @@ public final class RmiServerSingletons { "io.opentelemetry.rmi", RpcSpanNameExtractor.create(rpcAttributesGetter)) .addAttributesExtractor(RpcServerAttributesExtractor.create(rpcAttributesGetter)) - .newInstrumenter(SpanKindExtractor.alwaysServer()); + .buildInstrumenter(SpanKindExtractor.alwaysServer()); } public static Instrumenter instrumenter() { diff --git a/instrumentation/rocketmq-client-4.8/library/src/main/java/io/opentelemetry/instrumentation/rocketmq/RocketMqInstrumenterFactory.java b/instrumentation/rocketmq-client-4.8/library/src/main/java/io/opentelemetry/instrumentation/rocketmq/RocketMqInstrumenterFactory.java index 5fe25521da4f..d17319472848 100644 --- a/instrumentation/rocketmq-client-4.8/library/src/main/java/io/opentelemetry/instrumentation/rocketmq/RocketMqInstrumenterFactory.java +++ b/instrumentation/rocketmq-client-4.8/library/src/main/java/io/opentelemetry/instrumentation/rocketmq/RocketMqInstrumenterFactory.java @@ -44,9 +44,9 @@ static Instrumenter createProducerInstrumenter( } if (propagationEnabled) { - return instrumenterBuilder.newProducerInstrumenter(MapSetter.INSTANCE); + return instrumenterBuilder.buildProducerInstrumenter(MapSetter.INSTANCE); } else { - return instrumenterBuilder.newInstrumenter(SpanKindExtractor.alwaysProducer()); + return instrumenterBuilder.buildInstrumenter(SpanKindExtractor.alwaysProducer()); } } @@ -66,7 +66,7 @@ static RocketMqConsumerInstrumenter createConsumerInstrumenter( openTelemetry, captureExperimentalSpanAttributes, propagationEnabled, false), createProcessInstrumenter( openTelemetry, captureExperimentalSpanAttributes, propagationEnabled, true), - batchReceiveInstrumenterBuilder.newInstrumenter(SpanKindExtractor.alwaysConsumer())); + batchReceiveInstrumenterBuilder.buildInstrumenter(SpanKindExtractor.alwaysConsumer())); } private static Instrumenter createProcessInstrumenter( @@ -90,7 +90,7 @@ private static Instrumenter createProcessInstrumenter( } if (!propagationEnabled) { - return builder.newInstrumenter(SpanKindExtractor.alwaysConsumer()); + return builder.buildInstrumenter(SpanKindExtractor.alwaysConsumer()); } if (batch) { @@ -101,9 +101,9 @@ private static Instrumenter createProcessInstrumenter( return builder .addSpanLinksExtractor(spanLinksExtractor) - .newInstrumenter(SpanKindExtractor.alwaysConsumer()); + .buildInstrumenter(SpanKindExtractor.alwaysConsumer()); } else { - return builder.newConsumerInstrumenter(TextMapExtractAdapter.INSTANCE); + return builder.buildConsumerInstrumenter(TextMapExtractAdapter.INSTANCE); } } diff --git a/instrumentation/servlet/servlet-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/servlet/ServletInstrumenterBuilder.java b/instrumentation/servlet/servlet-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/servlet/ServletInstrumenterBuilder.java index 467003246633..3fdf57814de2 100644 --- a/instrumentation/servlet/servlet-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/servlet/ServletInstrumenterBuilder.java +++ b/instrumentation/servlet/servlet-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/servlet/ServletInstrumenterBuilder.java @@ -76,7 +76,7 @@ public Instrumenter, ServletResponseContext(accessor)); + return builder.buildServerInstrumenter(new ServletRequestGetter<>(accessor)); } public Instrumenter, ServletResponseContext> build( diff --git a/instrumentation/servlet/servlet-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/servlet/common/response/ResponseInstrumenterFactory.java b/instrumentation/servlet/servlet-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/servlet/common/response/ResponseInstrumenterFactory.java index 07f09bcfce71..77a8c156d677 100644 --- a/instrumentation/servlet/servlet-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/servlet/common/response/ResponseInstrumenterFactory.java +++ b/instrumentation/servlet/servlet-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/servlet/common/response/ResponseInstrumenterFactory.java @@ -15,7 +15,7 @@ public final class ResponseInstrumenterFactory { public static Instrumenter createInstrumenter(String instrumentationName) { return Instrumenter.builder( GlobalOpenTelemetry.get(), instrumentationName, SpanNames::fromMethod) - .newInstrumenter(); + .buildInstrumenter(); } private ResponseInstrumenterFactory() {} diff --git a/instrumentation/spring/spring-batch-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/batch/chunk/ChunkSingletons.java b/instrumentation/spring/spring-batch-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/batch/chunk/ChunkSingletons.java index ed4d67cefc08..6a2bf7745c8c 100644 --- a/instrumentation/spring/spring-batch-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/batch/chunk/ChunkSingletons.java +++ b/instrumentation/spring/spring-batch-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/batch/chunk/ChunkSingletons.java @@ -32,7 +32,7 @@ public class ChunkSingletons { instrumenterBuilder.addSpanLinksExtractor(ChunkSingletons::extractSpanLinks); } - INSTRUMENTER = instrumenterBuilder.newInstrumenter(); + INSTRUMENTER = instrumenterBuilder.buildInstrumenter(); } public static Instrumenter chunkInstrumenter() { diff --git a/instrumentation/spring/spring-batch-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/batch/item/ItemSingletons.java b/instrumentation/spring/spring-batch-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/batch/item/ItemSingletons.java index 800c00a2592f..86e436d021f9 100644 --- a/instrumentation/spring/spring-batch-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/batch/item/ItemSingletons.java +++ b/instrumentation/spring/spring-batch-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/batch/item/ItemSingletons.java @@ -22,7 +22,7 @@ public class ItemSingletons { private static final Instrumenter INSTRUMENTER = Instrumenter.builder( GlobalOpenTelemetry.get(), instrumentationName(), str -> str) - .newInstrumenter(); + .buildInstrumenter(); public static Instrumenter itemInstrumenter() { return INSTRUMENTER; diff --git a/instrumentation/spring/spring-batch-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/batch/job/JobSingletons.java b/instrumentation/spring/spring-batch-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/batch/job/JobSingletons.java index fff90877b95e..9e8c4f6e024b 100644 --- a/instrumentation/spring/spring-batch-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/batch/job/JobSingletons.java +++ b/instrumentation/spring/spring-batch-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/batch/job/JobSingletons.java @@ -16,7 +16,7 @@ public class JobSingletons { private static final Instrumenter INSTRUMENTER = Instrumenter.builder( GlobalOpenTelemetry.get(), instrumentationName(), JobSingletons::extractSpanName) - .newInstrumenter(); + .buildInstrumenter(); private static String extractSpanName(JobExecution jobExecution) { return "BatchJob " + jobExecution.getJobInstance().getJobName(); diff --git a/instrumentation/spring/spring-batch-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/batch/step/StepSingletons.java b/instrumentation/spring/spring-batch-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/batch/step/StepSingletons.java index ed9c7cb982ab..a4c052d7dc3e 100644 --- a/instrumentation/spring/spring-batch-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/batch/step/StepSingletons.java +++ b/instrumentation/spring/spring-batch-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/batch/step/StepSingletons.java @@ -16,7 +16,7 @@ public class StepSingletons { private static final Instrumenter INSTRUMENTER = Instrumenter.builder( GlobalOpenTelemetry.get(), instrumentationName(), StepSingletons::spanName) - .newInstrumenter(); + .buildInstrumenter(); public static Instrumenter stepInstrumenter() { return INSTRUMENTER; diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/aspects/WithSpanAspect.java b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/aspects/WithSpanAspect.java index f05e7a435094..359c443a2663 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/aspects/WithSpanAspect.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/aspects/WithSpanAspect.java @@ -49,7 +49,7 @@ public WithSpanAspect( JoinPointRequest::method, parameterAttributeNamesExtractor, JoinPointRequest::args)) - .newInstrumenter(WithSpanAspect::spanKind); + .buildInstrumenter(WithSpanAspect::spanKind); } private static String spanName(JoinPointRequest request) { diff --git a/instrumentation/spring/spring-data-1.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/data/SpringDataSingletons.java b/instrumentation/spring/spring-data-1.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/data/SpringDataSingletons.java index 575ca4373070..c1050f05fa01 100644 --- a/instrumentation/spring/spring-data-1.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/data/SpringDataSingletons.java +++ b/instrumentation/spring/spring-data-1.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/data/SpringDataSingletons.java @@ -15,7 +15,7 @@ public final class SpringDataSingletons { private static final Instrumenter INSTRUMENTER = Instrumenter.builder( GlobalOpenTelemetry.get(), "io.opentelemetry.spring-data-1.8", SpanNames::fromMethod) - .newInstrumenter(); + .buildInstrumenter(); public static Instrumenter instrumenter() { return INSTRUMENTER; diff --git a/instrumentation/spring/spring-integration-4.1/library/src/main/java/io/opentelemetry/instrumentation/spring/integration/SpringIntegrationTelemetryBuilder.java b/instrumentation/spring/spring-integration-4.1/library/src/main/java/io/opentelemetry/instrumentation/spring/integration/SpringIntegrationTelemetryBuilder.java index b1887a452a19..53152c318714 100644 --- a/instrumentation/spring/spring-integration-4.1/library/src/main/java/io/opentelemetry/instrumentation/spring/integration/SpringIntegrationTelemetryBuilder.java +++ b/instrumentation/spring/spring-integration-4.1/library/src/main/java/io/opentelemetry/instrumentation/spring/integration/SpringIntegrationTelemetryBuilder.java @@ -70,7 +70,7 @@ public SpringIntegrationTelemetry build() { .addAttributesExtractor( MessagingAttributesExtractor.create( SpringMessagingAttributesGetter.INSTANCE, MessageOperation.PROCESS)) - .newConsumerInstrumenter(MessageHeadersGetter.INSTANCE); + .buildConsumerInstrumenter(MessageHeadersGetter.INSTANCE); Instrumenter producerInstrumenter = Instrumenter.builder( @@ -81,7 +81,7 @@ public SpringIntegrationTelemetry build() { .addAttributesExtractor( MessagingAttributesExtractor.create( SpringMessagingAttributesGetter.INSTANCE, MessageOperation.SEND)) - .newInstrumenter(SpanKindExtractor.alwaysProducer()); + .buildInstrumenter(SpanKindExtractor.alwaysProducer()); return new SpringIntegrationTelemetry( openTelemetry.getPropagators(), consumerInstrumenter, diff --git a/instrumentation/spring/spring-jms-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/jms/SpringJmsSingletons.java b/instrumentation/spring/spring-jms-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/jms/SpringJmsSingletons.java index ee3b3a9d76c3..a32f847d64e1 100644 --- a/instrumentation/spring/spring-jms-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/jms/SpringJmsSingletons.java +++ b/instrumentation/spring/spring-jms-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/jms/SpringJmsSingletons.java @@ -29,7 +29,7 @@ private static Instrumenter buildListenerInstrumen INSTRUMENTATION_NAME, MessagingSpanNameExtractor.create(getter, operation)) .addAttributesExtractor(MessagingAttributesExtractor.create(getter, operation)) - .newConsumerInstrumenter(MessagePropertyGetter.INSTANCE); + .buildConsumerInstrumenter(MessagePropertyGetter.INSTANCE); } public static Instrumenter listenerInstrumenter() { diff --git a/instrumentation/spring/spring-rabbit-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/rabbit/SpringRabbitSingletons.java b/instrumentation/spring/spring-rabbit-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/rabbit/SpringRabbitSingletons.java index 6808fd6001f4..7019d0be9687 100644 --- a/instrumentation/spring/spring-rabbit-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/rabbit/SpringRabbitSingletons.java +++ b/instrumentation/spring/spring-rabbit-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/rabbit/SpringRabbitSingletons.java @@ -28,7 +28,7 @@ public final class SpringRabbitSingletons { INSTRUMENTATION_NAME, MessagingSpanNameExtractor.create(getter, operation)) .addAttributesExtractor(MessagingAttributesExtractor.create(getter, operation)) - .newConsumerInstrumenter(MessageHeaderGetter.INSTANCE); + .buildConsumerInstrumenter(MessageHeaderGetter.INSTANCE); } public static Instrumenter instrumenter() { diff --git a/instrumentation/spring/spring-rmi-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/springrmi/SpringRmiSingletons.java b/instrumentation/spring/spring-rmi-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/springrmi/SpringRmiSingletons.java index a8d17a43366f..fcb49d50a265 100644 --- a/instrumentation/spring/spring-rmi-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/springrmi/SpringRmiSingletons.java +++ b/instrumentation/spring/spring-rmi-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/springrmi/SpringRmiSingletons.java @@ -31,7 +31,7 @@ private static Instrumenter buildClientInstrumenter() { INSTRUMENTATION_NAME, RpcSpanNameExtractor.create(rpcAttributesGetter)) .addAttributesExtractor(RpcClientAttributesExtractor.create(rpcAttributesGetter)) - .newInstrumenter(SpanKindExtractor.alwaysClient()); + .buildInstrumenter(SpanKindExtractor.alwaysClient()); } private static Instrumenter buildServerInstrumenter() { @@ -42,7 +42,7 @@ private static Instrumenter buildServerInstrumenter() { INSTRUMENTATION_NAME, RpcSpanNameExtractor.create(rpcAttributesGetter)) .addAttributesExtractor(RpcServerAttributesExtractor.create(rpcAttributesGetter)) - .newInstrumenter(SpanKindExtractor.alwaysServer()); + .buildInstrumenter(SpanKindExtractor.alwaysServer()); } public static Instrumenter clientInstrumenter() { diff --git a/instrumentation/spring/spring-scheduling-3.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/scheduling/SpringSchedulingSingletons.java b/instrumentation/spring/spring-scheduling-3.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/scheduling/SpringSchedulingSingletons.java index 8636b285a8de..b2b4cc8a9b89 100644 --- a/instrumentation/spring/spring-scheduling-3.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/scheduling/SpringSchedulingSingletons.java +++ b/instrumentation/spring/spring-scheduling-3.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/scheduling/SpringSchedulingSingletons.java @@ -23,7 +23,7 @@ public final class SpringSchedulingSingletons { "io.opentelemetry.spring-scheduling-3.1", CodeSpanNameExtractor.create(codeAttributesGetter)) .addAttributesExtractor(CodeAttributesExtractor.create(codeAttributesGetter)) - .newInstrumenter(); + .buildInstrumenter(); } public static Instrumenter instrumenter() { diff --git a/instrumentation/spring/spring-web-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/web/SpringWebTelemetryBuilder.java b/instrumentation/spring/spring-web-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/web/SpringWebTelemetryBuilder.java index 6b02fc8da7ac..7cde4db42ea1 100644 --- a/instrumentation/spring/spring-web-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/web/SpringWebTelemetryBuilder.java +++ b/instrumentation/spring/spring-web-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/web/SpringWebTelemetryBuilder.java @@ -82,7 +82,7 @@ public SpringWebTelemetry build() { .addAttributesExtractor(NetClientAttributesExtractor.create(netAttributesGetter)) .addAttributesExtractors(additionalExtractors) .addOperationMetrics(HttpClientMetrics.get()) - .newClientInstrumenter(HttpRequestSetter.INSTANCE); + .buildClientInstrumenter(HttpRequestSetter.INSTANCE); return new SpringWebTelemetry(instrumenter); } diff --git a/instrumentation/spring/spring-webflux-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/webflux/server/WebfluxSingletons.java b/instrumentation/spring/spring-webflux-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/webflux/server/WebfluxSingletons.java index b028743f3784..56b325050997 100644 --- a/instrumentation/spring/spring-webflux-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/webflux/server/WebfluxSingletons.java +++ b/instrumentation/spring/spring-webflux-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/webflux/server/WebfluxSingletons.java @@ -30,7 +30,9 @@ public final class WebfluxSingletons { } INSTRUMENTER = - builder.setEnabled(ExperimentalConfig.get().controllerTelemetryEnabled()).newInstrumenter(); + builder + .setEnabled(ExperimentalConfig.get().controllerTelemetryEnabled()) + .buildInstrumenter(); } public static Instrumenter instrumenter() { diff --git a/instrumentation/spring/spring-webflux-5.0/library/src/main/java/io/opentelemetry/instrumentation/spring/webflux/client/SpringWebfluxTelemetryBuilder.java b/instrumentation/spring/spring-webflux-5.0/library/src/main/java/io/opentelemetry/instrumentation/spring/webflux/client/SpringWebfluxTelemetryBuilder.java index 0fb4f0bcf7b7..c1e5cb49a351 100644 --- a/instrumentation/spring/spring-webflux-5.0/library/src/main/java/io/opentelemetry/instrumentation/spring/webflux/client/SpringWebfluxTelemetryBuilder.java +++ b/instrumentation/spring/spring-webflux-5.0/library/src/main/java/io/opentelemetry/instrumentation/spring/webflux/client/SpringWebfluxTelemetryBuilder.java @@ -106,7 +106,7 @@ public SpringWebfluxTelemetry build() { // headers are injected elsewhere; ClientRequest is immutable Instrumenter instrumenter = - builder.newInstrumenter(alwaysClient()); + builder.buildInstrumenter(alwaysClient()); return new SpringWebfluxTelemetry(instrumenter, openTelemetry.getPropagators()); } diff --git a/instrumentation/spring/spring-webmvc-3.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/springwebmvc/SpringWebMvcSingletons.java b/instrumentation/spring/spring-webmvc-3.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/springwebmvc/SpringWebMvcSingletons.java index 11bcc3192b62..6844b6c7b7a5 100644 --- a/instrumentation/spring/spring-webmvc-3.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/springwebmvc/SpringWebMvcSingletons.java +++ b/instrumentation/spring/spring-webmvc-3.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/springwebmvc/SpringWebMvcSingletons.java @@ -22,7 +22,7 @@ public final class SpringWebMvcSingletons { Instrumenter.builder( GlobalOpenTelemetry.get(), INSTRUMENTATION_NAME, new HandlerSpanNameExtractor()) .setEnabled(ExperimentalConfig.get().controllerTelemetryEnabled()) - .newInstrumenter(); + .buildInstrumenter(); MODEL_AND_VIEW_INSTRUMENTER = Instrumenter.builder( @@ -31,7 +31,7 @@ public final class SpringWebMvcSingletons { new ModelAndViewSpanNameExtractor()) .addAttributesExtractor(new ModelAndViewAttributesExtractor()) .setEnabled(ExperimentalConfig.get().viewTelemetryEnabled()) - .newInstrumenter(); + .buildInstrumenter(); } public static Instrumenter handlerInstrumenter() { diff --git a/instrumentation/spring/spring-webmvc-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/webmvc/SpringWebMvcTelemetryBuilder.java b/instrumentation/spring/spring-webmvc-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/webmvc/SpringWebMvcTelemetryBuilder.java index 6f46e56303cf..a5cb9081033d 100644 --- a/instrumentation/spring/spring-webmvc-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/webmvc/SpringWebMvcTelemetryBuilder.java +++ b/instrumentation/spring/spring-webmvc-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/webmvc/SpringWebMvcTelemetryBuilder.java @@ -87,7 +87,7 @@ public SpringWebMvcTelemetry build() { .addAttributesExtractors(additionalExtractors) .addOperationMetrics(HttpServerMetrics.get()) .addContextCustomizer(HttpRouteHolder.get()) - .newServerInstrumenter(JavaxHttpServletRequestGetter.INSTANCE); + .buildServerInstrumenter(JavaxHttpServletRequestGetter.INSTANCE); return new SpringWebMvcTelemetry(instrumenter); } diff --git a/instrumentation/spring/spring-ws-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/ws/SpringWsSingletons.java b/instrumentation/spring/spring-ws-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/ws/SpringWsSingletons.java index 73d7f5b6f347..ada337d9118d 100644 --- a/instrumentation/spring/spring-ws-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/ws/SpringWsSingletons.java +++ b/instrumentation/spring/spring-ws-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/ws/SpringWsSingletons.java @@ -26,7 +26,7 @@ public class SpringWsSingletons { CodeSpanNameExtractor.create(codeAttributesGetter)) .addAttributesExtractor(CodeAttributesExtractor.create(codeAttributesGetter)) .setEnabled(ExperimentalConfig.get().controllerTelemetryEnabled()) - .newInstrumenter(); + .buildInstrumenter(); } public static Instrumenter instrumenter() { diff --git a/instrumentation/spymemcached-2.12/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spymemcached/SpymemcachedSingletons.java b/instrumentation/spymemcached-2.12/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spymemcached/SpymemcachedSingletons.java index 35a96745b1bc..29915cde16fa 100644 --- a/instrumentation/spymemcached-2.12/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spymemcached/SpymemcachedSingletons.java +++ b/instrumentation/spymemcached-2.12/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spymemcached/SpymemcachedSingletons.java @@ -25,7 +25,7 @@ public final class SpymemcachedSingletons { INSTRUMENTATION_NAME, DbClientSpanNameExtractor.create(dbAttributesGetter)) .addAttributesExtractor(DbClientAttributesExtractor.create(dbAttributesGetter)) - .newInstrumenter(SpanKindExtractor.alwaysClient()); + .buildInstrumenter(SpanKindExtractor.alwaysClient()); } public static Instrumenter instrumenter() { diff --git a/instrumentation/struts-2.3/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/struts2/StrutsSingletons.java b/instrumentation/struts-2.3/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/struts2/StrutsSingletons.java index 97b5eb1ae26f..e80083091eb3 100644 --- a/instrumentation/struts-2.3/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/struts2/StrutsSingletons.java +++ b/instrumentation/struts-2.3/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/struts2/StrutsSingletons.java @@ -27,7 +27,7 @@ public class StrutsSingletons { CodeSpanNameExtractor.create(codeAttributesGetter)) .addAttributesExtractor(CodeAttributesExtractor.create(codeAttributesGetter)) .setEnabled(ExperimentalConfig.get().controllerTelemetryEnabled()) - .newInstrumenter(); + .buildInstrumenter(); } public static Instrumenter instrumenter() { diff --git a/instrumentation/tapestry-5.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/tapestry/TapestrySingletons.java b/instrumentation/tapestry-5.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/tapestry/TapestrySingletons.java index b9df3d9b73c8..fd906e06bf09 100644 --- a/instrumentation/tapestry-5.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/tapestry/TapestrySingletons.java +++ b/instrumentation/tapestry-5.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/tapestry/TapestrySingletons.java @@ -28,7 +28,7 @@ public class TapestrySingletons { return ErrorCauseExtractor.jdk().extract(error); }) .setEnabled(ExperimentalConfig.get().controllerTelemetryEnabled()) - .newInstrumenter(); + .buildInstrumenter(); } public static Instrumenter instrumenter() { diff --git a/instrumentation/tomcat/tomcat-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/tomcat/common/TomcatInstrumenterFactory.java b/instrumentation/tomcat/tomcat-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/tomcat/common/TomcatInstrumenterFactory.java index a2db6f020340..503b88a99935 100644 --- a/instrumentation/tomcat/tomcat-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/tomcat/common/TomcatInstrumenterFactory.java +++ b/instrumentation/tomcat/tomcat-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/tomcat/common/TomcatInstrumenterFactory.java @@ -49,6 +49,6 @@ public static Instrumenter create( .recordException() .init(context)) .addOperationMetrics(HttpServerMetrics.get()) - .newServerInstrumenter(TomcatRequestGetter.INSTANCE); + .buildServerInstrumenter(TomcatRequestGetter.INSTANCE); } } diff --git a/instrumentation/twilio-6.6/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/twilio/TwilioSingletons.java b/instrumentation/twilio-6.6/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/twilio/TwilioSingletons.java index 18635e21f716..64be20ea1b4b 100644 --- a/instrumentation/twilio-6.6/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/twilio/TwilioSingletons.java +++ b/instrumentation/twilio-6.6/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/twilio/TwilioSingletons.java @@ -30,7 +30,7 @@ public class TwilioSingletons { instrumenterBuilder.addAttributesExtractor(new TwilioExperimentalAttributesExtractor()); } - INSTRUMENTER = instrumenterBuilder.newInstrumenter(alwaysClient()); + INSTRUMENTER = instrumenterBuilder.buildInstrumenter(alwaysClient()); } public static Instrumenter instrumenter() { diff --git a/instrumentation/undertow-1.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/undertow/UndertowSingletons.java b/instrumentation/undertow-1.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/undertow/UndertowSingletons.java index 8c45bb04f902..200a083b69c2 100644 --- a/instrumentation/undertow-1.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/undertow/UndertowSingletons.java +++ b/instrumentation/undertow-1.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/undertow/UndertowSingletons.java @@ -52,7 +52,7 @@ public final class UndertowSingletons { .init(context); }) .addOperationMetrics(HttpServerMetrics.get()) - .newServerInstrumenter(UndertowExchangeGetter.INSTANCE); + .buildServerInstrumenter(UndertowExchangeGetter.INSTANCE); } private static final UndertowHelper HELPER = new UndertowHelper(INSTRUMENTER); diff --git a/instrumentation/vaadin-14.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/vaadin/VaadinSingletons.java b/instrumentation/vaadin-14.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/vaadin/VaadinSingletons.java index b88a44ad54a0..e36711b6f264 100644 --- a/instrumentation/vaadin-14.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/vaadin/VaadinSingletons.java +++ b/instrumentation/vaadin-14.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/vaadin/VaadinSingletons.java @@ -38,7 +38,7 @@ public class VaadinSingletons { CodeSpanNameExtractor.create(clientCallableAttributesGetter)) .setEnabled(ExperimentalConfig.get().controllerTelemetryEnabled()) .addAttributesExtractor(CodeAttributesExtractor.create(clientCallableAttributesGetter)) - .newInstrumenter(); + .buildInstrumenter(); REQUEST_HANDLER_INSTRUMENTER = Instrumenter.builder( @@ -48,13 +48,13 @@ public class VaadinSingletons { .addContextCustomizer( (context, vaadinHandlerRequest, startAttributes) -> context.with(REQUEST_HANDLER_CONTEXT_KEY, Boolean.TRUE)) - .newInstrumenter(); + .buildInstrumenter(); RPC_INSTRUMENTER = Instrumenter.builder( GlobalOpenTelemetry.get(), INSTRUMENTATION_NAME, VaadinSingletons::rpcSpanName) .setEnabled(ExperimentalConfig.get().controllerTelemetryEnabled()) - .newInstrumenter(); + .buildInstrumenter(); SERVICE_INSTRUMENTER = Instrumenter.builder( @@ -64,7 +64,7 @@ public class VaadinSingletons { .addContextCustomizer( (context, vaadinServiceRequest, startAttributes) -> context.with(SERVICE_CONTEXT_KEY, new VaadinServiceContext())) - .newInstrumenter(); + .buildInstrumenter(); HELPER = new VaadinHelper(REQUEST_HANDLER_INSTRUMENTER, SERVICE_INSTRUMENTER); } diff --git a/instrumentation/vertx/vertx-http-client/vertx-http-client-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/vertx/client/VertxClientInstrumenterFactory.java b/instrumentation/vertx/vertx-http-client/vertx-http-client-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/vertx/client/VertxClientInstrumenterFactory.java index bef1598f0af1..116d1993cc21 100644 --- a/instrumentation/vertx/vertx-http-client/vertx-http-client-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/vertx/client/VertxClientInstrumenterFactory.java +++ b/instrumentation/vertx/vertx-http-client/vertx-http-client-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/vertx/client/VertxClientInstrumenterFactory.java @@ -49,7 +49,7 @@ public static Instrumenter create( netAttributesGetter, CommonConfig.get().getPeerServiceMapping())); } - return builder.newClientInstrumenter(new HttpRequestHeaderSetter()); + return builder.buildClientInstrumenter(new HttpRequestHeaderSetter()); } private VertxClientInstrumenterFactory() {} diff --git a/testing-common/src/main/java/io/opentelemetry/instrumentation/testing/TestInstrumenters.java b/testing-common/src/main/java/io/opentelemetry/instrumentation/testing/TestInstrumenters.java index 1474972bba58..203ae7b2e64f 100644 --- a/testing-common/src/main/java/io/opentelemetry/instrumentation/testing/TestInstrumenters.java +++ b/testing-common/src/main/java/io/opentelemetry/instrumentation/testing/TestInstrumenters.java @@ -31,19 +31,19 @@ final class TestInstrumenters { TestInstrumenters(OpenTelemetry openTelemetry) { instrumenter = Instrumenter.builder(openTelemetry, "test", name -> name) - .newInstrumenter(SpanKindExtractor.alwaysInternal()); + .buildInstrumenter(SpanKindExtractor.alwaysInternal()); httpClientInstrumenter = Instrumenter.builder(openTelemetry, "test", name -> name) // cover both semconv and span-kind strategies .addAttributesExtractor(new SpanKeyAttributesExtractor(SpanKey.HTTP_CLIENT)) .addAttributesExtractor(new SpanKeyAttributesExtractor(SpanKey.KIND_CLIENT)) - .newInstrumenter(SpanKindExtractor.alwaysClient()); + .buildInstrumenter(SpanKindExtractor.alwaysClient()); httpServerInstrumenter = Instrumenter.builder(openTelemetry, "test", name -> name) // cover both semconv and span-kind strategies .addAttributesExtractor(new SpanKeyAttributesExtractor(SpanKey.HTTP_SERVER)) .addAttributesExtractor(new SpanKeyAttributesExtractor(SpanKey.KIND_SERVER)) - .newInstrumenter(SpanKindExtractor.alwaysServer()); + .buildInstrumenter(SpanKindExtractor.alwaysServer()); } /**