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

Add code attributes to play mvc controller spans #13140

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jaydeluca
Copy link
Member

Related to #7345

I know there are still discussions (here and here) around these conventions, but figured another example might help us continue to validate

Is this the right approach?

@jaydeluca jaydeluca requested a review from a team as a code owner January 31, 2025 11:19
@trask
Copy link
Member

trask commented Jan 31, 2025

Is this the right approach?

👍

cc @SylvainJuge

Comment on lines +124 to +125
equalTo(CODE_NAMESPACE, "play.api.mvc.ActionBuilder$$anon$2"),
equalTo(CODE_FUNCTION, "apply"));
Copy link
Contributor

Choose a reason for hiding this comment

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

In my opinion this is not useful. It points to framework code and is the same for all endpoints.

Copy link
Contributor

Choose a reason for hiding this comment

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

I tend to agree with Lauri here, if the value is the same for all spans then it does not provide much value for the end-user as with it they can't guess which part of the application code is related to the span.

We will very likely have exactly the same kind of issues with Webflux or other reactive frameworks where the application code is provided through nested lambdas and can't be described with a dedicated class/method. For those cases, the "span identity" should be provided through other attributes for example HTTP verb, path or span name which allows the end-user to understand the link with application code.

If we capture this technical and implementation-specific information, do we have a way to make any good use of it ?

One example I could think of is if we attempt to correlate those attributes with another source of information like inferred spans or profiling, however for those the correlation would be implemented through trace and span ID rather than on those code-level attributes.

I think this example is really interesting from the perspective of semconv attributes clarification as there are at least two distinct use-cases for those attributes:

  • provide more information about a span for the end-user: we may recommend to capture information that is related to the application code rather than framework/library details
  • capture "technical information" in a structured way that could not be described otherwise: profiling, inferred spans, ...

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.

4 participants