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 @@ -14,7 +14,7 @@
import javax.annotation.Nullable;

public class AkkaHttpClientUtil {
@Nullable private static final MethodHandle actorSystemAccessor = findActorSystemAccessor();
@Nullable private static final MethodHandle ACTOR_SYSTEM_ACCESSOR = findActorSystemAccessor();

@Nullable
private static MethodHandle findActorSystemAccessor() {
Expand All @@ -37,12 +37,12 @@ private static MethodHandle findActorSystemAccessor(Class<?> type) {

@Nullable
public static ActorSystem getActorSystem(HttpExt httpExt) {
if (actorSystemAccessor == null) {
if (ACTOR_SYSTEM_ACCESSOR == null) {
return null;
}

try {
return (ActorSystem) actorSystemAccessor.invoke(httpExt);
return (ActorSystem) ACTOR_SYSTEM_ACCESSOR.invoke(httpExt);
} catch (Throwable ignored) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import java.util.ArrayList;
import java.util.List;

final class AkkaHttpResponseMutator implements HttpServerResponseMutator<HttpResponse> {
class AkkaHttpResponseMutator implements HttpServerResponseMutator<HttpResponse> {

private final List<HttpHeader> headers = new ArrayList<>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import java.util.stream.StreamSupport;
import javax.annotation.Nullable;

final class AkkaHttpServerHeaders implements TextMapGetter<HttpRequest> {
class AkkaHttpServerHeaders implements TextMapGetter<HttpRequest> {

@Override
public Iterable<String> keys(HttpRequest httpRequest) {
Expand Down
9 changes: 9 additions & 0 deletions instrumentation/akka/akka-http-10.0/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,46 +13,55 @@ features:
- CONTEXT_PROPAGATION
configurations:
- name: otel.instrumentation.http.known-methods
declarative_name: java.common.http.known_methods
description: >
Configures the instrumentation to recognize an alternative set of HTTP request methods. All
other methods will be treated as `_OTHER`.
type: list
default: "CONNECT,DELETE,GET,HEAD,OPTIONS,PATCH,POST,PUT,TRACE"
- name: otel.instrumentation.http.client.capture-request-headers
declarative_name: general.http.client.request_captured_headers
description: List of HTTP request headers to capture in HTTP client telemetry.
type: list
default: ""
- name: otel.instrumentation.http.client.capture-response-headers
declarative_name: general.http.client.response_captured_headers
description: List of HTTP response headers to capture in HTTP client telemetry.
type: list
default: ""
- name: otel.instrumentation.common.peer-service-mapping
declarative_name: java.common.peer_service_mapping
description: Used to specify a mapping from host names or IP addresses to peer services.
type: map
default: ""
- name: otel.instrumentation.http.client.emit-experimental-telemetry
declarative_name: java.common.http.client.emit_experimental_telemetry/development
description: >
Enable the capture of experimental HTTP client telemetry. Adds the `http.request.body.size`
and `http.response.body.size` attributes to spans, and records `http.client.request.size` and
`http.client.response.size` metrics.
type: boolean
default: false
- name: otel.instrumentation.http.server.capture-request-headers
declarative_name: general.http.server.request_captured_headers
description: List of HTTP request headers to capture in HTTP server telemetry.
type: list
default: ""
- name: otel.instrumentation.http.server.capture-response-headers
declarative_name: general.http.server.response_captured_headers
description: List of HTTP response headers to capture in HTTP server telemetry.
type: list
default: ""
- name: otel.instrumentation.http.server.emit-experimental-telemetry
declarative_name: java.common.http.server.emit_experimental_telemetry/development
description: >
Enable the capture of experimental HTTP server telemetry. Adds the `http.request.body.size`
and `http.response.body.size` attributes to spans, and records `http.server.request.size` and
`http.server.response.size` metrics.
type: boolean
default: false
- name: otel.instrumentation.sanitization.url.experimental.sensitive-query-parameters
declarative_name: general.sanitization.url.sensitive_query_parameters/development
description: List of URL query parameter names whose values are redacted in URL attributes. See https://opentelemetry.io/docs/specs/semconv/http/http-spans.
type: list
default: "AWSAccessKeyId,Signature,sig,X-Goog-Signature"
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@
public final class ApacheHttpClientTelemetryBuilder {

private static final String INSTRUMENTATION_NAME = "io.opentelemetry.apache-httpclient-4.3";
private final DefaultHttpClientInstrumenterBuilder<ApacheHttpClientRequest, HttpResponse> builder;
private final OpenTelemetry openTelemetry;

static {
Experimental.internalSetEmitExperimentalTelemetry(
(builder, emit) -> builder.builder.setEmitExperimentalHttpClientTelemetry(emit));
}

private final DefaultHttpClientInstrumenterBuilder<ApacheHttpClientRequest, HttpResponse> builder;
private final OpenTelemetry openTelemetry;

ApacheHttpClientTelemetryBuilder(OpenTelemetry openTelemetry) {
builder =
DefaultHttpClientInstrumenterBuilder.create(
Expand Down
Loading