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

Make server.socket.* attributes on the HTTP server side opt-in #8747

Conversation

mateuszrzeszutek
Copy link
Member

This is just the span attributes; for metric attributes I'm hoping that my idea to use the advice API catches on.

@mateuszrzeszutek mateuszrzeszutek requested a review from a team as a code owner June 16, 2023 13:46
Comment on lines +75 to +105
@CanIgnoreReturnValue
public HttpServerAttributesExtractorBuilder<REQUEST, RESPONSE> setCaptureServerSocketAttributes(
boolean captureServerSocketAttributes) {
this.captureServerSocketAttributes = captureServerSocketAttributes;
return this;
}
Copy link
Member

Choose a reason for hiding this comment

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

My understanding is that we don't have to support opt-in things. I'd personally suggest we not provide this configuration unless someone has specific need now, and we can wait to see how your advice PR pans out.

Copy link
Member Author

Choose a reason for hiding this comment

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

spec

Instrumentations SHOULD populate the attribute if and only if the user configures the instrumentation to do so. Instrumentation that doesn't support configuration MUST NOT populate Opt-In attributes.

It's not very explicit about optional support for these; although there is a "SHOULD" here, so it flies, I think. I'm fine with that; and also this is a good subject for the general advice proposed in #3557

@mateuszrzeszutek
Copy link
Member Author

@open-telemetry/java-instrumentation-approvers please review this PR 🙏

@trask
Copy link
Member

trask commented Jul 14, 2023

@lmolkova do you remember why server.socket.* are opt-in for HTTP server spans?

@mateuszrzeszutek mateuszrzeszutek force-pushed the optional-server-socket-attributes branch from 655ad34 to b45ffd7 Compare July 17, 2023 10:15
@lmolkova
Copy link
Contributor

@lmolkova do you remember why server.socket.* are opt-in for HTTP server spans?

One reason I can think about is that they represent local host/port and are the same for all spans coming from a typical single-host application - this way they're captured best with resource attributes

@mateuszrzeszutek mateuszrzeszutek merged commit c21ea0f into open-telemetry:main Jul 19, 2023
45 checks passed
@mateuszrzeszutek mateuszrzeszutek deleted the optional-server-socket-attributes branch July 19, 2023 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants