Rename some *InstrumenterBuilder classes to *InstrumenterFactory
MODIFY
instrumentation/kafka-clients/kafka-clients-0.11/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/kafkaclients/KafkaSingletons.java
instrumentation/kafka-clients/kafka-clients-0.11/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/kafkaclients/KafkaSingletons.java
package io.opentelemetry.javaagent.instrumentation.kafkaclients;
import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter;
-import io.opentelemetry.instrumentation.kafka.internal.KafkaInstrumenterBuilder;
+import io.opentelemetry.instrumentation.kafka.internal.KafkaInstrumenterFactory;
import io.opentelemetry.instrumentation.kafka.internal.ReceivedRecords;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.clients.producer.ProducerRecord;
@@ -15,11 +15,11 @@ public final class KafkaSingletons {
private static final String INSTRUMENTATION_NAME = "io.opentelemetry.kafka-clients-0.11";
private static final Instrumenter<ProducerRecord<?, ?>, Void> PRODUCER_INSTRUMENTER =
- KafkaInstrumenterBuilder.buildProducerInstrumenter(INSTRUMENTATION_NAME);
+ KafkaInstrumenterFactory.createProducerInstrumenter(INSTRUMENTATION_NAME);
private static final Instrumenter<ReceivedRecords, Void> CONSUMER_RECEIVE_INSTRUMENTER =
- KafkaInstrumenterBuilder.buildConsumerReceiveInstrumenter(INSTRUMENTATION_NAME);
+ KafkaInstrumenterFactory.createConsumerReceiveInstrumenter(INSTRUMENTATION_NAME);
private static final Instrumenter<ConsumerRecord<?, ?>, Void> CONSUMER_PROCESS_INSTRUMENTER =
- KafkaInstrumenterBuilder.buildConsumerProcessInstrumenter(INSTRUMENTATION_NAME);
+ KafkaInstrumenterFactory.createConsumerProcessInstrumenter(INSTRUMENTATION_NAME);
public static Instrumenter<ProducerRecord<?, ?>, Void> producerInstrumenter() {
return PRODUCER_INSTRUMENTER;

MODIFY
instrumentation/kafka-clients/kafka-clients-2.6/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/KafkaTracingBuilder.java
instrumentation/kafka-clients/kafka-clients-2.6/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/KafkaTracingBuilder.java
@@ -8,7 +8,7 @@ package io.opentelemetry.instrumentation.kafkaclients;
import io.opentelemetry.api.OpenTelemetry;
import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor;
import io.opentelemetry.instrumentation.api.instrumenter.messaging.MessageOperation;
-import io.opentelemetry.instrumentation.kafka.internal.KafkaInstrumenterBuilder;
+import io.opentelemetry.instrumentation.kafka.internal.KafkaInstrumenterFactory;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
@@ -43,9 +43,9 @@ public final class KafkaTracingBuilder {
public KafkaTracing build() {
return new KafkaTracing(
openTelemetry,
- KafkaInstrumenterBuilder.buildProducerInstrumenter(
+ KafkaInstrumenterFactory.createProducerInstrumenter(
INSTRUMENTATION_NAME, openTelemetry, producerAttributesExtractors),
- KafkaInstrumenterBuilder.buildConsumerOperationInstrumenter(
+ KafkaInstrumenterFactory.createConsumerOperationInstrumenter(
INSTRUMENTATION_NAME,
openTelemetry,
MessageOperation.RECEIVE,

RENAME
instrumentation/kafka-clients/kafka-clients-common/library/src/main/java/io/opentelemetry/instrumentation/kafka/internal/KafkaInstrumenterBuilder.java
instrumentation/kafka-clients/kafka-clients-common/library/src/main/java/io/opentelemetry/instrumentation/kafka/internal/KafkaInstrumenterFactory.java
@@ -20,15 +20,15 @@ import java.util.Collections;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.clients.producer.ProducerRecord;
-public final class KafkaInstrumenterBuilder {
+public final class KafkaInstrumenterFactory {
- public static Instrumenter<ProducerRecord<?, ?>, Void> buildProducerInstrumenter(
+ public static Instrumenter<ProducerRecord<?, ?>, Void> createProducerInstrumenter(
String instrumentationName) {
- return buildProducerInstrumenter(
+ return createProducerInstrumenter(
instrumentationName, GlobalOpenTelemetry.get(), Collections.emptyList());
}
- public static Instrumenter<ProducerRecord<?, ?>, Void> buildProducerInstrumenter(
+ public static Instrumenter<ProducerRecord<?, ?>, Void> createProducerInstrumenter(
String instrumentationName,
OpenTelemetry openTelemetry,
Iterable<AttributesExtractor<ProducerRecord<?, ?>, Void>> extractors) {
@@ -44,13 +44,13 @@ public final class KafkaInstrumenterBuilder {
.newInstrumenter(SpanKindExtractor.alwaysProducer());
}
- public static Instrumenter<ReceivedRecords, Void> buildConsumerReceiveInstrumenter(
+ public static Instrumenter<ReceivedRecords, Void> createConsumerReceiveInstrumenter(
String instrumentationName) {
- return buildConsumerReceiveInstrumenter(
+ return createConsumerReceiveInstrumenter(
instrumentationName, GlobalOpenTelemetry.get(), Collections.emptyList());
}
- public static Instrumenter<ReceivedRecords, Void> buildConsumerReceiveInstrumenter(
+ public static Instrumenter<ReceivedRecords, Void> createConsumerReceiveInstrumenter(
String instrumentationName,
OpenTelemetry openTelemetry,
Iterable<AttributesExtractor<ReceivedRecords, Void>> extractors) {
@@ -67,16 +67,16 @@ public final class KafkaInstrumenterBuilder {
.newInstrumenter(SpanKindExtractor.alwaysConsumer());
}
- public static Instrumenter<ConsumerRecord<?, ?>, Void> buildConsumerProcessInstrumenter(
+ public static Instrumenter<ConsumerRecord<?, ?>, Void> createConsumerProcessInstrumenter(
String instrumentationName) {
- return buildConsumerOperationInstrumenter(
+ return createConsumerOperationInstrumenter(
instrumentationName,
GlobalOpenTelemetry.get(),
MessageOperation.PROCESS,
Collections.emptyList());
}
- public static Instrumenter<ConsumerRecord<?, ?>, Void> buildConsumerOperationInstrumenter(
+ public static Instrumenter<ConsumerRecord<?, ?>, Void> createConsumerOperationInstrumenter(
String instrumentationName,
OpenTelemetry openTelemetry,
MessageOperation operation,
@@ -108,5 +108,5 @@ public final class KafkaInstrumenterBuilder {
}
}
- private KafkaInstrumenterBuilder() {}
+ private KafkaInstrumenterFactory() {}
}

MODIFY
instrumentation/kafka-streams-0.11/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/kafkastreams/KafkaStreamsSingletons.java
instrumentation/kafka-streams-0.11/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/kafkastreams/KafkaStreamsSingletons.java
package io.opentelemetry.javaagent.instrumentation.kafkastreams;
import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter;
-import io.opentelemetry.instrumentation.kafka.internal.KafkaInstrumenterBuilder;
+import io.opentelemetry.instrumentation.kafka.internal.KafkaInstrumenterFactory;
import org.apache.kafka.clients.consumer.ConsumerRecord;
public final class KafkaStreamsSingletons {
@@ -16,7 +16,7 @@ public final class KafkaStreamsSingletons {
private static final Instrumenter<ConsumerRecord<?, ?>, Void> INSTRUMENTER = buildInstrumenter();
private static Instrumenter<ConsumerRecord<?, ?>, Void> buildInstrumenter() {
- return KafkaInstrumenterBuilder.buildConsumerProcessInstrumenter(INSTRUMENTATION_NAME);
+ return KafkaInstrumenterFactory.createConsumerProcessInstrumenter(INSTRUMENTATION_NAME);
}
public static Instrumenter<ConsumerRecord<?, ?>, Void> instrumenter() {

MODIFY
instrumentation/tomcat/tomcat-10.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/tomcat/v10_0/Tomcat10Singletons.java
instrumentation/tomcat/tomcat-10.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/tomcat/v10_0/Tomcat10Singletons.java
@@ -9,7 +9,7 @@ import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter;
import io.opentelemetry.javaagent.instrumentation.servlet.v5_0.Servlet5Accessor;
import io.opentelemetry.javaagent.instrumentation.servlet.v5_0.Servlet5Singletons;
import io.opentelemetry.javaagent.instrumentation.tomcat.common.TomcatHelper;
-import io.opentelemetry.javaagent.instrumentation.tomcat.common.TomcatInstrumenterBuilder;
+import io.opentelemetry.javaagent.instrumentation.tomcat.common.TomcatInstrumenterFactory;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.apache.coyote.Request;
@@ -18,7 +18,7 @@ import org.apache.coyote.Response;
public final class Tomcat10Singletons {
private static final String INSTRUMENTATION_NAME = "io.opentelemetry.tomcat-10.0";
private static final Instrumenter<Request, Response> INSTRUMENTER =
- TomcatInstrumenterBuilder.newInstrumenter(
+ TomcatInstrumenterFactory.create(
INSTRUMENTATION_NAME, Servlet5Accessor.INSTANCE, Tomcat10ServletEntityProvider.INSTANCE);
private static final TomcatHelper<HttpServletRequest, HttpServletResponse> HELPER =
new TomcatHelper<>(

MODIFY
instrumentation/tomcat/tomcat-7.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/tomcat/v7_0/Tomcat7Singletons.java
instrumentation/tomcat/tomcat-7.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/tomcat/v7_0/Tomcat7Singletons.java
@@ -9,7 +9,7 @@ import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter;
import io.opentelemetry.javaagent.instrumentation.servlet.v3_0.Servlet3Accessor;
import io.opentelemetry.javaagent.instrumentation.servlet.v3_0.Servlet3Singletons;
import io.opentelemetry.javaagent.instrumentation.tomcat.common.TomcatHelper;
-import io.opentelemetry.javaagent.instrumentation.tomcat.common.TomcatInstrumenterBuilder;
+import io.opentelemetry.javaagent.instrumentation.tomcat.common.TomcatInstrumenterFactory;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.coyote.Request;
@@ -18,7 +18,7 @@ import org.apache.coyote.Response;
public final class Tomcat7Singletons {
private static final String INSTRUMENTATION_NAME = "io.opentelemetry.tomcat-7.0";
private static final Instrumenter<Request, Response> INSTRUMENTER =
- TomcatInstrumenterBuilder.newInstrumenter(
+ TomcatInstrumenterFactory.create(
INSTRUMENTATION_NAME, Servlet3Accessor.INSTANCE, Tomcat7ServletEntityProvider.INSTANCE);
private static final TomcatHelper<HttpServletRequest, HttpServletResponse> HELPER =
new TomcatHelper<>(

RENAME
instrumentation/tomcat/tomcat-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/tomcat/common/TomcatInstrumenterBuilder.java
instrumentation/tomcat/tomcat-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/tomcat/common/TomcatInstrumenterFactory.java
@@ -24,11 +24,11 @@ import io.opentelemetry.javaagent.instrumentation.servlet.ServletErrorCauseExtra
import org.apache.coyote.Request;
import org.apache.coyote.Response;
-public final class TomcatInstrumenterBuilder {
+public final class TomcatInstrumenterFactory {
- private TomcatInstrumenterBuilder() {}
+ private TomcatInstrumenterFactory() {}
- public static <REQUEST, RESPONSE> Instrumenter<Request, Response> newInstrumenter(
+ public static <REQUEST, RESPONSE> Instrumenter<Request, Response> create(
String instrumentationName,
ServletAccessor<REQUEST, RESPONSE> accessor,
TomcatServletEntityProvider<REQUEST, RESPONSE> servletEntityProvider) {

Rename some *InstrumenterBuilder classes to *InstrumenterFactory (#4391)