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 general and source code attributes to spans #517

Open
tsloughter opened this issue Dec 9, 2022 · 5 comments
Open

Add general and source code attributes to spans #517

tsloughter opened this issue Dec 9, 2022 · 5 comments
Labels
enhancement New feature or request good first issue Good for newcomers language-elixir language-erlang spec A change to the SDK specification that must be implemented.

Comments

@tsloughter
Copy link
Member

@tsloughter tsloughter added enhancement New feature or request good first issue Good for newcomers spec A change to the SDK specification that must be implemented. language-erlang language-elixir labels Dec 9, 2022
@bullno1
Copy link
Contributor

bullno1 commented Dec 13, 2022

I kinda need this too.

This is only possible in macro right?

@tsloughter
Copy link
Member Author

Correct, it would need to be done in the macros for with_span and start_span.

@bullno1
Copy link
Contributor

bullno1 commented Dec 13, 2022

https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/span-general.md#general-thread-attributes

On the topic of thread.id attribute, erlang:system_info(scheduler_id) is suggested.
While this is kind of correct, I'm not sure how useful it is compared to say: self().
But formatting self() can have some overhead that is not always desirable.

@bullno1
Copy link
Contributor

bullno1 commented Dec 13, 2022

On the same topic code.function also requires some string/binary construction from ?FUNCTION_NAME and ?FUNCTION_ARITY.
It's probably negligible but it's not nothing, even in the non-recording case.

There are 2 ways to go about this:

  • Just format anyway.
  • Introduce some sort of "lazy attributes" that's only evaluated by the span processor. {'$lazy', fun()}?

@tsloughter
Copy link
Member Author

I think just format (lists:concat(?FUNCTION_NAME, "/", ?FUNCTION_ARITY)) it anyway and we should look at proposing ?FUNCTION_NAME_STRING that includes arity to OTP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers language-elixir language-erlang spec A change to the SDK specification that must be implemented.
Projects
None yet
Development

No branches or pull requests

2 participants