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 url from HttpServerAttributesExtractor #4209

Conversation

trask
Copy link
Member

@trask trask commented Sep 27, 2021

follow-up to #4195

resolves #3700
resolves #3699

if (publicAddress == null) {
return null;
}
return publicAddress.builder().build().getScheme();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use

Suggested change
return publicAddress.builder().build().getScheme();
return publicAddress.get().getScheme();

instead of building another copy?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh that's much better(!)

@trask trask force-pushed the remove-url-from-http-server-attributes-extractor branch from e40881f to 13da1a2 Compare September 28, 2021 16:40
@trask trask marked this pull request as ready for review September 29, 2021 03:26
@@ -120,7 +115,6 @@ void normal() {
assertThat(attributes.build())
.containsOnly(
entry(SemanticAttributes.HTTP_METHOD, "POST"),
entry(SemanticAttributes.HTTP_URL, "http:https://github.com"),
entry(SemanticAttributes.HTTP_TARGET, "github.com"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect I fudged - this test case should probably be changed to something that looks more normal, e.g. /repositories/1

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed 😄

@Nullable
protected String host(Request request) {
return null;
URI uri = publicAddress.get();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Private method to get the public address (the simplification I was hoping for with my TODO didn't materialize...

Comment on lines 26 to 27
**[1]:** Most server instrumentation captures `http.scheme`, `http.host`, and `http.target`
(and does not capture `http.url`).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
**[1]:** Most server instrumentation captures `http.scheme`, `http.host`, and `http.target`
(and does not capture `http.url`).
**[1]:** Most server instrumentations capture `http.scheme`, `http.host`, and `http.target`
(and do not capture `http.url`).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went back and forth on this 😂

docs/semantic-conventions.md Outdated Show resolved Hide resolved
@trask trask merged commit 92394ad into open-telemetry:main Oct 3, 2021
@trask trask deleted the remove-url-from-http-server-attributes-extractor branch October 3, 2021 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants