Skip to content
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 @@ -31,6 +31,7 @@
import io.opentelemetry.instrumentation.api.semconv.http.HttpSpanNameExtractor;
import io.opentelemetry.instrumentation.api.semconv.http.HttpSpanNameExtractorBuilder;
import io.opentelemetry.instrumentation.api.semconv.http.HttpSpanStatusExtractor;
import io.opentelemetry.semconv.SchemaUrls;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
Expand Down Expand Up @@ -245,7 +246,8 @@ public Instrumenter<REQUEST, RESPONSE> build() {
statusExtractorTransformer.apply(HttpSpanStatusExtractor.create(attributesGetter)))
.addAttributesExtractor(httpAttributesExtractorBuilder.build())
.addAttributesExtractors(additionalExtractors)
.addOperationMetrics(HttpClientMetrics.get());
.addOperationMetrics(HttpClientMetrics.get())
.setSchemaUrl(SchemaUrls.V1_37_0);
Copy link
Contributor

Choose a reason for hiding this comment

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

does setting schema url pose any additional restrictions to what we can do with these instrumentations?

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 can still emit additional attributes if that what you're asking?

if (emitExperimentalHttpClientTelemetry) {
builder
.addAttributesExtractor(HttpExperimentalAttributesExtractor.create(attributesGetter))
Expand All @@ -263,7 +265,9 @@ public Instrumenter<REQUEST, RESPONSE> build() {
public <BUILDERREQUEST, BUILDERRESPONSE>
InstrumenterBuilder<BUILDERREQUEST, BUILDERRESPONSE> instrumenterBuilder(
SpanNameExtractor<? super BUILDERREQUEST> spanNameExtractor) {
return Instrumenter.builder(openTelemetry, instrumentationName, spanNameExtractor);
return Instrumenter.<BUILDERREQUEST, BUILDERRESPONSE>builder(
openTelemetry, instrumentationName, spanNameExtractor)
.setSchemaUrl(SchemaUrls.V1_37_0);
}

@CanIgnoreReturnValue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import io.opentelemetry.instrumentation.api.semconv.http.HttpSpanNameExtractor;
import io.opentelemetry.instrumentation.api.semconv.http.HttpSpanNameExtractorBuilder;
import io.opentelemetry.instrumentation.api.semconv.http.HttpSpanStatusExtractor;
import io.opentelemetry.semconv.SchemaUrls;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
Expand Down Expand Up @@ -207,7 +208,8 @@ public InstrumenterBuilder<REQUEST, RESPONSE> instrumenterBuilder() {
.addAttributesExtractor(httpAttributesExtractorBuilder.build())
.addAttributesExtractors(additionalExtractors)
.addContextCustomizer(httpServerRouteBuilder.build())
.addOperationMetrics(HttpServerMetrics.get());
.addOperationMetrics(HttpServerMetrics.get())
.setSchemaUrl(SchemaUrls.V1_37_0);
if (emitExperimentalHttpServerTelemetry) {
builder
.addAttributesExtractor(HttpExperimentalAttributesExtractor.create(attributesGetter))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import io.opentelemetry.javaagent.bootstrap.internal.AgentCommonConfig;
import io.opentelemetry.javaagent.bootstrap.internal.JavaagentHttpClientInstrumenters;
import io.opentelemetry.javaagent.instrumentation.netty.v3_8.HttpRequestAndChannel;
import io.opentelemetry.semconv.SchemaUrls;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.handler.codec.http.HttpResponse;

Expand Down Expand Up @@ -45,6 +46,7 @@ public final class NettyClientSingletons {
HttpClientPeerServiceAttributesExtractor.create(
NettyConnectHttpAttributesGetter.INSTANCE,
AgentCommonConfig.get().getPeerServiceResolver()))
.setSchemaUrl(SchemaUrls.V1_37_0)
.buildInstrumenter(SpanKindExtractor.alwaysClient());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ void longCounter() {
.hasInstrumentationScope(
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.setSchemaUrl("http://schema.org")
.build())
.hasLongSumSatisfying(
sum ->
Expand Down Expand Up @@ -106,6 +107,7 @@ void observableLongCounter() throws InterruptedException {
.hasInstrumentationScope(
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.setSchemaUrl("http://schema.org")
.build())
.hasLongSumSatisfying(
sum ->
Expand Down Expand Up @@ -147,6 +149,7 @@ void doubleCounter() {
.hasInstrumentationScope(
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.setSchemaUrl("http://schema.org")
.build())
.hasDoubleSumSatisfying(
sum ->
Expand Down Expand Up @@ -182,6 +185,7 @@ void observableDoubleCounter() throws InterruptedException {
.hasInstrumentationScope(
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.setSchemaUrl("http://schema.org")
.build())
.hasDoubleSumSatisfying(
sum ->
Expand Down Expand Up @@ -223,6 +227,7 @@ void longUpDownCounter() {
.hasInstrumentationScope(
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.setSchemaUrl("http://schema.org")
.build())
.hasLongSumSatisfying(
sum ->
Expand Down Expand Up @@ -257,6 +262,7 @@ void observableLongUpDownCounter() throws InterruptedException {
.hasInstrumentationScope(
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.setSchemaUrl("http://schema.org")
.build())
.hasLongSumSatisfying(
sum ->
Expand Down Expand Up @@ -298,6 +304,7 @@ void doubleUpDownCounter() {
.hasInstrumentationScope(
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.setSchemaUrl("http://schema.org")
.build())
.hasDoubleSumSatisfying(
sum ->
Expand Down Expand Up @@ -333,6 +340,7 @@ void observableDoubleUpDownCounter() throws InterruptedException {
.hasInstrumentationScope(
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.setSchemaUrl("http://schema.org")
.build())
.hasDoubleSumSatisfying(
sum ->
Expand Down Expand Up @@ -374,6 +382,7 @@ void longHistogram() {
.hasInstrumentationScope(
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.setSchemaUrl("http://schema.org")
.build())
.hasHistogramSatisfying(
histogram ->
Expand Down Expand Up @@ -405,6 +414,7 @@ void doubleHistogram() {
.hasInstrumentationScope(
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.setSchemaUrl("http://schema.org")
.build())
.hasHistogramSatisfying(
histogram ->
Expand Down Expand Up @@ -439,6 +449,7 @@ void longGauge() throws InterruptedException {
.hasInstrumentationScope(
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.setSchemaUrl("http://schema.org")
.build())
.hasLongGaugeSatisfying(
gauge ->
Expand Down Expand Up @@ -481,6 +492,7 @@ void doubleGauge() throws InterruptedException {
.hasInstrumentationScope(
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.setSchemaUrl("http://schema.org")
.build())
.hasDoubleGaugeSatisfying(
gauge ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ void batchLongCounter() throws InterruptedException {
.hasInstrumentationScope(
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.setSchemaUrl("http://schema.org")
.build())
.hasLongSumSatisfying(
sum ->
Expand Down Expand Up @@ -112,6 +113,7 @@ void batchDoubleCounter() throws InterruptedException {
.hasInstrumentationScope(
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.setSchemaUrl("http://schema.org")
.build())
.hasDoubleSumSatisfying(
sum ->
Expand Down Expand Up @@ -157,6 +159,7 @@ void batchLongUpDownCounter() throws InterruptedException {
.hasInstrumentationScope(
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.setSchemaUrl("http://schema.org")
.build())
.hasLongSumSatisfying(
sum ->
Expand Down Expand Up @@ -207,6 +210,7 @@ void batchDoubleUpDownCounter() throws InterruptedException {
.hasInstrumentationScope(
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.setSchemaUrl("http://schema.org")
.build())
.hasDoubleSumSatisfying(
sum ->
Expand Down Expand Up @@ -252,6 +256,7 @@ void batchLongGauge() throws InterruptedException {
.hasInstrumentationScope(
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.setSchemaUrl("http://schema.org")
.build())
.hasLongGaugeSatisfying(
gauge ->
Expand Down Expand Up @@ -296,6 +301,7 @@ void batchDoubleGauge() throws InterruptedException {
.hasInstrumentationScope(
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.setSchemaUrl("http://schema.org")
.build())
.hasDoubleGaugeSatisfying(
gauge ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ void longCounter() {
.hasInstrumentationScope(
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.setSchemaUrl("http://schema.org")
.build())
.hasLongSumSatisfying(
sum ->
Expand Down Expand Up @@ -128,6 +129,7 @@ void doubleCounter() {
.hasInstrumentationScope(
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.setSchemaUrl("http://schema.org")
.build())
.hasDoubleSumSatisfying(
sum ->
Expand Down Expand Up @@ -165,6 +167,7 @@ void longUpDownCounter() {
.hasInstrumentationScope(
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.setSchemaUrl("http://schema.org")
.build())
.hasLongSumSatisfying(
sum ->
Expand Down Expand Up @@ -203,6 +206,7 @@ void doubleUpDownCounter() {
.hasInstrumentationScope(
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.setSchemaUrl("http://schema.org")
.build())
.hasDoubleSumSatisfying(
sum ->
Expand Down Expand Up @@ -241,6 +245,7 @@ void longHistogram() {
.hasInstrumentationScope(
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.setSchemaUrl("http://schema.org")
.build())
.hasHistogramSatisfying(
histogram ->
Expand Down Expand Up @@ -279,6 +284,7 @@ void doubleHistogram() {
.hasInstrumentationScope(
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.setSchemaUrl("http://schema.org")
.build())
.hasHistogramSatisfying(
histogram ->
Expand Down Expand Up @@ -316,6 +322,7 @@ void longGauge() throws InterruptedException {
.hasInstrumentationScope(
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.setSchemaUrl("http://schema.org")
.build())
.hasLongGaugeSatisfying(
gauge ->
Expand Down Expand Up @@ -360,6 +367,7 @@ void syncLongGauge() throws InterruptedException {
.hasInstrumentationScope(
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.setSchemaUrl("http://schema.org")
.build())
.hasLongGaugeSatisfying(
gauge ->
Expand Down Expand Up @@ -403,6 +411,7 @@ void doubleGauge() throws InterruptedException {
.hasInstrumentationScope(
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.setSchemaUrl("http://schema.org")
.build())
.hasDoubleGaugeSatisfying(
gauge ->
Expand Down Expand Up @@ -446,6 +455,7 @@ void syncDoubleGauge() throws InterruptedException {
.hasInstrumentationScope(
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.setSchemaUrl("http://schema.org")
.build())
.hasDoubleGaugeSatisfying(
gauge ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ void longCounter() {
.hasInstrumentationScope(
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.setSchemaUrl("http://schema.org")
.build())
.hasLongSumSatisfying(
sum ->
Expand Down Expand Up @@ -128,6 +129,7 @@ void doubleCounter() {
.hasInstrumentationScope(
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.setSchemaUrl("http://schema.org")
.build())
.hasDoubleSumSatisfying(
sum ->
Expand Down Expand Up @@ -165,6 +167,7 @@ void longUpDownCounter() {
.hasInstrumentationScope(
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.setSchemaUrl("http://schema.org")
.build())
.hasLongSumSatisfying(
sum ->
Expand Down Expand Up @@ -203,6 +206,7 @@ void doubleUpDownCounter() {
.hasInstrumentationScope(
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.setSchemaUrl("http://schema.org")
.build())
.hasDoubleSumSatisfying(
sum ->
Expand Down Expand Up @@ -241,6 +245,7 @@ void longHistogram() {
.hasInstrumentationScope(
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.setSchemaUrl("http://schema.org")
.build())
.hasHistogramSatisfying(
histogram ->
Expand Down Expand Up @@ -279,6 +284,7 @@ void doubleHistogram() {
.hasInstrumentationScope(
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.setSchemaUrl("http://schema.org")
.build())
.hasHistogramSatisfying(
histogram ->
Expand Down Expand Up @@ -316,6 +322,7 @@ void longGauge() throws InterruptedException {
.hasInstrumentationScope(
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.setSchemaUrl("http://schema.org")
.build())
.hasLongGaugeSatisfying(
gauge ->
Expand Down Expand Up @@ -360,6 +367,7 @@ void syncLongGauge() throws InterruptedException {
.hasInstrumentationScope(
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.setSchemaUrl("http://schema.org")
.build())
.hasLongGaugeSatisfying(
gauge ->
Expand Down Expand Up @@ -403,6 +411,7 @@ void doubleGauge() throws InterruptedException {
.hasInstrumentationScope(
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.setSchemaUrl("http://schema.org")
.build())
.hasDoubleGaugeSatisfying(
gauge ->
Expand Down Expand Up @@ -446,6 +455,7 @@ void syncDoubleGauge() throws InterruptedException {
.hasInstrumentationScope(
InstrumentationScopeInfo.builder(instrumentationName)
.setVersion("1.2.3")
.setSchemaUrl("http://schema.org")
.build())
.hasDoubleGaugeSatisfying(
gauge ->
Expand Down
Loading
Loading