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 deprecated HTTP semconv code #7259

Merged
merged 1 commit into from
Nov 21, 2022
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 @@ -36,37 +36,13 @@ public final class HttpServerAttributesExtractor<REQUEST, RESPONSE>
REQUEST, RESPONSE, HttpServerAttributesGetter<REQUEST, RESPONSE>>
implements SpanKeyProvider {

/**
* Creates the HTTP server attributes extractor with default configuration.
*
* @deprecated Use {@link #create(HttpServerAttributesGetter, NetServerAttributesGetter)} instead.
*/
@Deprecated
public static <REQUEST, RESPONSE> HttpServerAttributesExtractor<REQUEST, RESPONSE> create(
HttpServerAttributesGetter<REQUEST, RESPONSE> httpAttributesGetter) {
return create(httpAttributesGetter, new NoopNetServerAttributesGetter<>());
}

/** Creates the HTTP server attributes extractor with default configuration. */
public static <REQUEST, RESPONSE> HttpServerAttributesExtractor<REQUEST, RESPONSE> create(
HttpServerAttributesGetter<REQUEST, RESPONSE> httpAttributesGetter,
NetServerAttributesGetter<REQUEST> netAttributesGetter) {
return builder(httpAttributesGetter, netAttributesGetter).build();
}

/**
* Returns a new {@link HttpServerAttributesExtractorBuilder} that can be used to configure the
* HTTP client attributes extractor.
*
* @deprecated Use {@link #builder(HttpServerAttributesGetter, NetServerAttributesGetter)}
* instead.
*/
@Deprecated
public static <REQUEST, RESPONSE> HttpServerAttributesExtractorBuilder<REQUEST, RESPONSE> builder(
HttpServerAttributesGetter<REQUEST, RESPONSE> httpAttributesGetter) {
return builder(httpAttributesGetter, new NoopNetServerAttributesGetter<>());
}

/**
* Returns a new {@link HttpServerAttributesExtractorBuilder} that can be used to configure the
* HTTP client attributes extractor.
Expand Down Expand Up @@ -186,26 +162,4 @@ private String clientIp(REQUEST request) {
public SpanKey internalGetSpanKey() {
return SpanKey.HTTP_SERVER;
}

private static class NoopNetServerAttributesGetter<REQUEST>
implements NetServerAttributesGetter<REQUEST> {

@Nullable
@Override
public String transport(REQUEST request) {
return null;
}

@Nullable
@Override
public String hostName(REQUEST request) {
return null;
}

@Nullable
@Override
public Integer hostPort(REQUEST request) {
return null;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,4 @@ public interface HttpServerAttributesGetter<REQUEST, RESPONSE>

@Nullable
String scheme(REQUEST request);

/**
* The primary server name of the matched virtual host. This should be obtained via configuration,
* not from the Host header. If no such configuration can be obtained, this method should return
* {@code null}.
*
* @deprecated This method is deprecated and will be removed in the next release.
*/
@Nullable
@Deprecated
default String serverName(REQUEST request) {
throw new UnsupportedOperationException(
"This method is deprecated and will be removed in the next release");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,39 +20,11 @@ public interface NetClientAttributesGetter<REQUEST, RESPONSE> {
@Nullable
String transport(REQUEST request, @Nullable RESPONSE response);

/**
* Logical remote hostname.
*
* @deprecated This method is deprecated and will be removed in the next release.
*/
@Deprecated
@Nullable
default String peerName(REQUEST request, @Nullable RESPONSE response) {
throw new UnsupportedOperationException(
"This method is deprecated and will be removed in the next release");
}

@Nullable
default String peerName(REQUEST request) {
return peerName(request, null);
}
String peerName(REQUEST request);

/**
* Logical remote port number.
*
* @deprecated This method is deprecated and will be removed in the next release.
*/
@Deprecated
@Nullable
default Integer peerPort(REQUEST request, @Nullable RESPONSE response) {
throw new UnsupportedOperationException(
"This method is deprecated and will be removed in the next release");
}

@Nullable
default Integer peerPort(REQUEST request) {
return peerPort(request, null);
}
Integer peerPort(REQUEST request);

@Nullable
default String sockFamily(REQUEST request, @Nullable RESPONSE response) {
Expand Down