Skip to content

Commit

Permalink
Remove old experimental properties in CapturedHttpHeaders (open-telem…
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Rzeszutek authored and RashmiRam committed May 23, 2022
1 parent d06558c commit 86aed27
Showing 1 changed file with 4 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,51 +39,31 @@ public static CapturedHttpHeaders empty() {
private static final String CLIENT_RESPONSE_PROPERTY =
"otel.instrumentation.http.capture-headers.client.response";

// TODO: remove the experimental properties after 1.8.0 release
private static final String EXPERIMENTAL_CLIENT_REQUEST_PROPERTY =
"otel.instrumentation.common.experimental.capture-http-headers.client.request";
private static final String EXPERIMENTAL_CLIENT_RESPONSE_PROPERTY =
"otel.instrumentation.common.experimental.capture-http-headers.client.response";

/**
* Returns a configuration that captures HTTP client request and response headers as configured in
* the received {@code config}.
*/
public static CapturedHttpHeaders client(Config config) {
// fall back to the experimental properties if the stable one isn't supplied
return CapturedHttpHeaders.create(
config.getList(
CLIENT_REQUEST_PROPERTY,
config.getList(EXPERIMENTAL_CLIENT_REQUEST_PROPERTY, emptyList())),
config.getList(
CLIENT_RESPONSE_PROPERTY,
config.getList(EXPERIMENTAL_CLIENT_RESPONSE_PROPERTY, emptyList())));
config.getList(CLIENT_REQUEST_PROPERTY, emptyList()),
config.getList(CLIENT_RESPONSE_PROPERTY, emptyList()));
}

private static final String SERVER_REQUEST_PROPERTY =
"otel.instrumentation.http.capture-headers.server.request";
private static final String SERVER_RESPONSE_PROPERTY =
"otel.instrumentation.http.capture-headers.server.response";

// TODO: remove the experimental properties after 1.8.0 release
private static final String EXPERIMENTAL_SERVER_REQUEST_PROPERTY =
"otel.instrumentation.common.experimental.capture-http-headers.server.request";
private static final String EXPERIMENTAL_SERVER_RESPONSE_PROPERTY =
"otel.instrumentation.common.experimental.capture-http-headers.server.response";

/**
* Returns a configuration that captures HTTP server request and response headers as configured in
* the received {@code config}.
*/
public static CapturedHttpHeaders server(Config config) {
// fall back to the experimental properties if the stable one isn't supplied
return CapturedHttpHeaders.create(
config.getList(
SERVER_REQUEST_PROPERTY,
config.getList(EXPERIMENTAL_SERVER_REQUEST_PROPERTY, emptyList())),
config.getList(
SERVER_RESPONSE_PROPERTY,
config.getList(EXPERIMENTAL_SERVER_RESPONSE_PROPERTY, emptyList())));
config.getList(SERVER_REQUEST_PROPERTY, emptyList()),
config.getList(SERVER_RESPONSE_PROPERTY, emptyList()));
}

/**
Expand Down

0 comments on commit 86aed27

Please sign in to comment.