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" attribute to spans every time it is possible #7907

Closed
FBibonne opened this issue Feb 24, 2023 · 5 comments
Closed

Add "code" attribute to spans every time it is possible #7907

FBibonne opened this issue Feb 24, 2023 · 5 comments
Labels
enhancement New feature or request needs author feedback Waiting for additional feedback from the author stale

Comments

@FBibonne
Copy link

In order to better understand bugs into a single app component, I suggest it would be usefull to add "code.function", "code.namespace" and "code.lineno" attributes to spans when it is possible. The issue #7345 is limited to controller spans so I suggested to extend it to every span where possible.

Instead of rewriting every instrument, I wonder if it is possible to write an agent extension which would systematically add the code.* attributes to the span.

@FBibonne FBibonne added the enhancement New feature or request label Feb 24, 2023
@laurit
Copy link
Contributor

laurit commented Mar 8, 2023

@FBibonne could you provide samples where you believe code. function and code.namespace are currently missing but would be useful.

@trask trask added the needs author feedback Waiting for additional feedback from the author label Aug 15, 2023
@github-actions
Copy link
Contributor

This has been automatically marked as stale because it has been marked as needing author feedback and has not had any activity for 7 days. It will be closed automatically if there is no response from the author within 7 additional days from this comment.

@github-actions github-actions bot added the stale label Aug 22, 2023
@FBibonne
Copy link
Author

The first sample I think about is "jdbc span" : you see the SQL request but you don't know which line of code triggered it and if the SQL request is not specific enough, you can't guess the line of of code.

I have to redo my trials to give more samples. But to my mind, if you monitor a legacy code which is not instrumented with business spans, you may have difficulty to find where a slow trace (SQL, http client, ...) come from to fix it.

@github-actions github-actions bot removed needs author feedback Waiting for additional feedback from the author stale labels Aug 29, 2023
@laurit
Copy link
Contributor

laurit commented Aug 29, 2023

The first sample I think about is "jdbc span" : you see the SQL request but you don't know which line of code triggered it and if the SQL request is not specific enough, you can't guess the line of of code.

Usually code.function and code.namespace point to the code that created the span (see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/span-general.md#source-code-attributes), which in case of jdbc happens inside the PreparedStatement implementation class (jdbc driver code, or our jdbc driver wrapper in case of manual instrumentation) and would report the same values for all prepared statements. As you can see it wouldn't really help in determining where the query originates from. An alternative would be to use the caller of the PreparedStatement which could return useful info when jdbc api is used directly, but if it is accessed through an abstraction, like spring jdbc support classes, it would still point inside the library code and be useless.

@laurit laurit added the needs author feedback Waiting for additional feedback from the author label Aug 29, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2023

This has been automatically marked as stale because it has been marked as needing author feedback and has not had any activity for 7 days. It will be closed automatically if there is no response from the author within 7 additional days from this comment.

@github-actions github-actions bot added the stale label Sep 5, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs author feedback Waiting for additional feedback from the author stale
Projects
None yet
Development

No branches or pull requests

3 participants