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

Remove old experimental properties in CapturedHttpHeaders #5524

Merged
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 @@ -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