Skip to content

Commit

Permalink
Add http client metrics to apache http library instrumentation (#8128)
Browse files Browse the repository at this point in the history
  • Loading branch information
laurit authored Mar 24, 2023
1 parent de0f51e commit 178bfd4
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import io.opentelemetry.instrumentation.api.instrumenter.SpanKindExtractor;
import io.opentelemetry.instrumentation.api.instrumenter.http.HttpClientAttributesExtractor;
import io.opentelemetry.instrumentation.api.instrumenter.http.HttpClientAttributesExtractorBuilder;
import io.opentelemetry.instrumentation.api.instrumenter.http.HttpClientMetrics;
import io.opentelemetry.instrumentation.api.instrumenter.http.HttpSpanNameExtractor;
import io.opentelemetry.instrumentation.api.instrumenter.http.HttpSpanStatusExtractor;
import java.util.ArrayList;
Expand Down Expand Up @@ -87,6 +88,7 @@ public ApacheHttpClientTelemetry build() {
.setSpanStatusExtractor(HttpSpanStatusExtractor.create(httpAttributesGetter))
.addAttributesExtractor(httpAttributesExtractorBuilder.build())
.addAttributesExtractors(additionalExtractors)
.addOperationMetrics(HttpClientMetrics.get())
// We manually inject because we need to inject internal requests for redirects.
.buildInstrumenter(SpanKindExtractor.alwaysClient());

Expand Down

0 comments on commit 178bfd4

Please sign in to comment.