Skip to content

Add code.* semantic attributes details to spec#319

Open
Yas-Franco wants to merge 3 commits into
microprofile:mainfrom
Yas-Franco:code-attributes
Open

Add code.* semantic attributes details to spec#319
Yas-Franco wants to merge 3 commits into
microprofile:mainfrom
Yas-Franco:code-attributes

Conversation

@Yas-Franco
Copy link
Copy Markdown
Contributor

For #107

Comment thread spec/src/main/asciidoc/tracing.adoc Outdated
[[sec:code-conventions]]
==== Code Attributes

The https://github.com/open-telemetry/semantic-conventions/blob/v1.40.0/docs/registry/attributes/code.md[Semantic Conventions for code attributes] provide context about source code.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The version number should use the variable defined in the spec

Comment on lines +46 to +47
Span context MUST also contain the mandatory code attribute `code.function.name` as outlined in the <<sec:code-attributes>> sec.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We probably need few more datapoints about the possible overhead and feasability.

For example for Payara (and OpenLiberty alike I believe) it is trivial to know the method name, because the annotation is implemented via an Interceptor. I don't find definitive whether these attributes are added by Java Agent or whether they can be configured in that scenario. It seems like they can't though.

Semantic conventions does not impose a particular Requirement Level for code.function.name, but in cases where this information would be possibly expensive to obtain the convention recommend Opt-In.

We don't have any opt-in configuration facility in the spec yet, we could consider configuration property such as mp.otel.with-span.code-attributes.enable to explicitly request runtime to fill in the attribute.

Also looking at open-telemetry/opentelemetry-java-instrumentation#7345, it looks that agent is adding code attributes for Jakarta Rest Resource methods, which is something that should also be considered, even without Opt-In.

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.

3 participants