Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Change all instrumentation names to io.opentelemetry.{libName}-{libVersion} #3411

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,20 @@
*/
public class Instrumenter<REQUEST, RESPONSE> {

/** Returns a new {@link InstrumenterBuilder}. */
/**
* Returns a new {@link InstrumenterBuilder}.
*
* <p>The {@code instrumentationName} is the name of the instrumentation library, not the name of
* the instrument*ed* library. The value passed in this parameter should uniquely identify the
* instrumentation library so that during troubleshooting it's possible to pinpoint what tracer
* produced problematic telemetry.
*
* <p>In this project we use a convention to encode the minimum supported version of the
* instrument*ed* library into the instrumentation name, for example {@code
* io.opentelemetry.apache-httpclient-4.0}. This way, if there are different instrumentations for
* different library versions it's easy to find out which instrumentations produced the telemetry
* data.
*/
public static <REQUEST, RESPONSE> InstrumenterBuilder<REQUEST, RESPONSE> newBuilder(
OpenTelemetry openTelemetry,
String instrumentationName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ protected BaseTracer(OpenTelemetry openTelemetry) {
* troubleshooting it's possible to pinpoint what tracer produced problematic telemetry.
*
* <p>In this project we use a convention to encode the version of the instrument*ed* library into
* the instrumentation name, for example {@code io.opentelemetry.javaagent.apache-httpclient-4.0}.
* This way, if there are different instrumentations for different library versions it's easy to
* find out which instrumentations produced the telemetry data.
* the instrumentation name, for example {@code io.opentelemetry.apache-httpclient-4.0}. This way,
* if there are different instrumentations for different library versions it's easy to find out
* which instrumentations produced the telemetry data.
*
* @see io.opentelemetry.api.trace.TracerProvider#get(String, String)
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@ protected TextMapSetter<AkkaHttpHeaders> getSetter() {

@Override
protected String getInstrumentationName() {
return "io.opentelemetry.javaagent.akka-http-10.0";
return "io.opentelemetry.akka-http-10.0";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ protected TextMapGetter<HttpRequest> getGetter() {

@Override
protected String getInstrumentationName() {
return "io.opentelemetry.javaagent.akka-http-10.0";
return "io.opentelemetry.akka-http-10.0";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class CamelTracer extends BaseTracer {

@Override
protected String getInstrumentationName() {
return "io.opentelemetry.javaagent.apache-camel-2.20";
return "io.opentelemetry.apache-camel-2.20";
}

public Scope startClientScope(Span span) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void end(Context context, Result result) {

@Override
protected String getInstrumentationName() {
return "io.opentelemetry.javaagent.apache-dubbo-2.7";
return "io.opentelemetry.apache-dubbo-2.7";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ private static String header(HttpMessage message, String name) {

@Override
protected String getInstrumentationName() {
return "io.opentelemetry.javaagent.apache-httpasyncclient-4.1";
return "io.opentelemetry.apache-httpasyncclient-4.1";
}

/** This method is overridden to allow other classes in this package to call it. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
import org.apache.commons.httpclient.HttpMethod;

public final class ApacheHttpClientSingletons {
private static final String INSTRUMENTATION_NAME =
"io.opentelemetry.javaagent.apache-httpclient-2.0";
private static final String INSTRUMENTATION_NAME = "io.opentelemetry.apache-httpclient-2.0";

private static final Instrumenter<HttpMethod, HttpMethod> INSTRUMENTER;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
import org.apache.http.client.methods.HttpUriRequest;

public final class ApacheHttpClientSingletons {
private static final String INSTRUMENTATION_NAME =
"io.opentelemetry.javaagent.apache-httpclient-4.0";
private static final String INSTRUMENTATION_NAME = "io.opentelemetry.apache-httpclient-4.0";

private static final Instrumenter<HttpUriRequest, HttpResponse> INSTRUMENTER;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
import org.apache.hc.core5.http.HttpResponse;

public final class ApacheHttpClientSingletons {
private static final String INSTRUMENTATION_NAME =
"io.opentelemetry.javaagent.apache-httpclient-5.0";
private static final String INSTRUMENTATION_NAME = "io.opentelemetry.apache-httpclient-5.0";

private static final Instrumenter<ClassicHttpRequest, HttpResponse> INSTRUMENTER;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ protected TextMapSetter<Request> getSetter() {

@Override
protected String getInstrumentationName() {
return "io.opentelemetry.javaagent.async-http-client-1.9";
return "io.opentelemetry.async-http-client-1.9";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
import org.asynchttpclient.Response;

public final class AsyncHttpClientSingletons {
private static final String INSTRUMENTATION_NAME =
"io.opentelemetry.javaagent.async-http-client-2.0";
private static final String INSTRUMENTATION_NAME = "io.opentelemetry.async-http-client-2.0";

private static final Instrumenter<Request, Response> INSTRUMENTER;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ protected TextMapSetter<Request<?>> getSetter() {

@Override
protected String getInstrumentationName() {
return "io.opentelemetry.javaagent.aws-sdk-1.11";
return "io.opentelemetry.aws-sdk-1.11";
}

static final class NamesCache extends ClassValue<ConcurrentHashMap<String, String>> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ private static String header(SdkHttpHeaders headers, String name) {

@Override
protected String getInstrumentationName() {
return "io.opentelemetry.javaagent.aws-sdk-2.2";
return "io.opentelemetry.aws-sdk-2.2";
}

/** This method is overridden to allow other classes in this package to call it. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import io.opentelemetry.instrumentation.api.instrumenter.db.DbSpanNameExtractor;

public final class CassandraSingletons {
private static final String INSTRUMENTATION_NAME = "io.opentelemetry.javaagent.cassandra-3.0";
private static final String INSTRUMENTATION_NAME = "io.opentelemetry.cassandra-3.0";

// could use RESPONSE "ResultSet" here, but using RESPONSE "ExecutionInfo" in cassandra-4.0
// instrumentation (see comment over there for why), so also using here for consistency
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import io.opentelemetry.instrumentation.api.instrumenter.db.DbSpanNameExtractor;

public final class CassandraSingletons {
private static final String INSTRUMENTATION_NAME = "io.opentelemetry.javaagent.cassandra-4.0";
private static final String INSTRUMENTATION_NAME = "io.opentelemetry.cassandra-4.0";

// using ExecutionInfo because we can get that from ResultSet, AsyncResultSet and DriverException
private static final Instrumenter<CassandraRequest, ExecutionInfo> INSTRUMENTER;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ protected InetSocketAddress peerAddress(Void connection) {

@Override
protected String getInstrumentationName() {
return "io.opentelemetry.javaagent.couchbase-2.0";
return "io.opentelemetry.couchbase-2.0";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ public static DropwizardTracer tracer() {

@Override
protected String getInstrumentationName() {
return "io.opentelemetry.javaagent.dropwizard-views-0.7";
return "io.opentelemetry.dropwizard-views-0.7";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ protected String dbOperation(Void connection, String operation, String ignored)

@Override
protected String getInstrumentationName() {
return "io.opentelemetry.javaagent.elasticsearch-rest-common";
return "io.opentelemetry.elasticsearch-rest-common";
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a few of those "common" tracers -- I'm hoping that once we migrate to the Instrumenter API everywhere those common modules will just contain shared extractor code, and each instrumentation module will construct their instrumenter separately and give it a separate name that'll contain a proper version.

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ protected String dbOperation(Void connection, Object action, String operation) {

@Override
protected String getInstrumentationName() {
return "io.opentelemetry.javaagent.elasticsearch-transport-common";
return "io.opentelemetry.elasticsearch-transport-common";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static ExternalAnnotationTracer tracer() {

@Override
protected String getInstrumentationName() {
return "io.opentelemetry.javaagent.external-annotations";
return "io.opentelemetry.external-annotations";
}

public Context startSpan(Method method) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static FinatraTracer tracer() {

@Override
protected String getInstrumentationName() {
return "io.opentelemetry.javaagent.finatra-2.9";
return "io.opentelemetry.finatra-2.9";
}

public Context startSpan(Context parentContext, Class<?> clazz) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import io.opentelemetry.instrumentation.api.instrumenter.db.DbSpanNameExtractor;

public final class GeodeSingletons {
private static final String INSTRUMENTATION_NAME = "io.opentelemetry.javaagent.geode-1.4";
private static final String INSTRUMENTATION_NAME = "io.opentelemetry.geode-1.4";

private static final Instrumenter<GeodeRequest, Void> INSTRUMENTER;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public Context startSpan(Context parentContext, HttpRequest request) {

@Override
protected String getInstrumentationName() {
return "io.opentelemetry.javaagent.google-http-client-1.19";
return "io.opentelemetry.google-http-client-1.19";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ private static String getServerSpanName(Context context, GrailsControllerUrlMapp

@Override
protected String getInstrumentationName() {
return "io.opentelemetry.javaagent.grails-3.0";
return "io.opentelemetry.grails-3.0";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ protected TextMapGetter<HttpRequestPacket> getGetter() {

@Override
protected String getInstrumentationName() {
return "io.opentelemetry.javaagent.grizzly-2.0";
return "io.opentelemetry.grizzly-2.0";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

public final class GwtSingletons {

private static final String INSTRUMENTATION_NAME = "io.opentelemetry.javaagent.gwt-2.0";
private static final String INSTRUMENTATION_NAME = "io.opentelemetry.gwt-2.0";

public static final ContextKey<Boolean> RPC_CONTEXT_KEY =
ContextKey.named("opentelemetry-gwt-rpc-context-key");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ String entityName(Object entity) {

@Override
protected String getInstrumentationName() {
return "io.opentelemetry.javaagent.hibernate-common";
return "io.opentelemetry.hibernate-common";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ protected TextMapSetter<HttpURLConnection> getSetter() {

@Override
protected String getInstrumentationName() {
return "io.opentelemetry.javaagent.http-url-connection";
return "io.opentelemetry.http-url-connection";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static HystrixTracer tracer() {

@Override
protected String getInstrumentationName() {
return "io.opentelemetry.javaagent.hystrix-1.4";
return "io.opentelemetry.hystrix-1.4";
}

public void onCommand(Span span, HystrixInvokableInfo<?> command, String methodName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static JdkHttpClientTracer tracer() {

@Override
protected String getInstrumentationName() {
return "io.opentelemetry.javaagent.java-http-client";
return "io.opentelemetry.java-http-client";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ protected TextMapSetter<ClientRequest> getSetter() {

@Override
protected String getInstrumentationName() {
return "io.opentelemetry.javaagent.jaxrs-client-1.1";
return "io.opentelemetry.jaxrs-client-1.1";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ protected Throwable unwrapThrowable(Throwable throwable) {

@Override
protected String getInstrumentationName() {
return "io.opentelemetry.javaagent.jaxrs-client-2.0";
return "io.opentelemetry.jaxrs-client-2.0";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ protected Throwable unwrapThrowable(Throwable throwable) {

@Override
protected String getInstrumentationName() {
return "io.opentelemetry.javaagent.jaxrs-client-2.0-resteasy-3.0";
return "io.opentelemetry.jaxrs-client-2.0-resteasy-3.0";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,6 @@ private static String buildSpanName(Path classPath, Path methodPath) {

@Override
protected String getInstrumentationName() {
return "io.opentelemetry.javaagent.jaxrs-1.0";
return "io.opentelemetry.jaxrs-1.0";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,6 @@ private static String buildSpanName(Path classPath, Path methodPath) {

@Override
protected String getInstrumentationName() {
return "io.opentelemetry.javaagent.jaxrs-2.0-common";
return "io.opentelemetry.jaxrs-2.0-common";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,6 @@ public void end(MessageContext message, Throwable throwable) {

@Override
protected String getInstrumentationName() {
return "io.opentelemetry.javaagent.jaxws-2.0-axis2-1.6";
return "io.opentelemetry.jaxws-2.0-axis2-1.6";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,6 @@ public void stopSpan(Message message) {

@Override
protected String getInstrumentationName() {
return "io.opentelemetry.javaagent.jaxws-2.0-cxf-3.0";
return "io.opentelemetry.jaxws-2.0-cxf-3.0";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,6 @@ public void storeThrowable(Packet packet, Throwable throwable) {

@Override
protected String getInstrumentationName() {
return "io.opentelemetry.javaagent.jaxws-2.0-metro-2.2";
return "io.opentelemetry.jaxws-2.0-metro-2.2";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static JaxWsTracer tracer() {

@Override
protected String getInstrumentationName() {
return "io.opentelemetry.javaagent.jaxws-common";
return "io.opentelemetry.jaxws-common";
}

public Context startSpan(Class<?> target, Method method) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import io.opentelemetry.javaagent.instrumentation.api.instrumenter.PeerServiceAttributesExtractor;

public final class JdbcSingletons {
private static final String INSTRUMENTATION_NAME = "io.opentelemetry.javaagent.jdbc";
private static final String INSTRUMENTATION_NAME = "io.opentelemetry.jdbc";

private static final Instrumenter<DbRequest, Void> INSTRUMENTER;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import javax.sql.DataSource;

public final class DataSourceSingletons {
private static final String INSTRUMENTATION_NAME = "io.opentelemetry.javaagent.jdbc";
private static final String INSTRUMENTATION_NAME = "io.opentelemetry.jdbc";

private static final Instrumenter<DataSource, Void> INSTRUMENTER;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import io.opentelemetry.javaagent.instrumentation.api.instrumenter.PeerServiceAttributesExtractor;

public final class JedisSingletons {
private static final String INSTRUMENTATION_NAME = "io.opentelemetry.javaagent.jedis-1.4";
private static final String INSTRUMENTATION_NAME = "io.opentelemetry.jedis-1.4";

private static final Instrumenter<JedisRequest, Void> INSTRUMENTER;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import io.opentelemetry.javaagent.instrumentation.api.instrumenter.PeerServiceAttributesExtractor;

public final class JedisSingletons {
private static final String INSTRUMENTATION_NAME = "io.opentelemetry.javaagent.jedis-3.0";
private static final String INSTRUMENTATION_NAME = "io.opentelemetry.jedis-3.0";

private static final Instrumenter<JedisRequest, Void> INSTRUMENTER;

Expand Down
Loading