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

Extend included vars #107

Merged
merged 3 commits into from
May 3, 2023
Merged

Conversation

leggebroten
Copy link
Contributor

Issues

  1. OTLP attribute values can only accept strings, integers, doubles/floats, or boolean.

https://hexdocs.pm/opentelemetry_api/OpenTelemetry.html#t:attributes_map/0

Currently if the target of the :include is not one of these primitives, the attribute will not be added to the span.

  1. :include cannot handle string-key maps as a bound variable

Solutions provided

  1. do an inspect if attribute value is not one of the allowed primitives.
  2. Handle indexing into string-keyed map

@marcdel
Copy link
Owner

marcdel commented May 3, 2023

Thanks so much for this! Gimme a bit to wrap my head around it, but it looks good!

@fendent
Copy link

fendent commented May 3, 2023

Just started using this and just came here to see if someone had done something like this. Looking forward to seeing this merged!

@marcdel
Copy link
Owner

marcdel commented May 3, 2023

@fendent yooo! curious which part: the inspect on non-otel approved types, or indexing into string keyed maps?

@fendent
Copy link

fendent commented May 3, 2023

@fendent yooo! curious which part: the inspect on non-otel approved types, or indexing into string keyed maps?

Both actually! I made a quick proto of the string keyed map but haven't had time to flesh it out.

@marcdel
Copy link
Owner

marcdel commented May 3, 2023

Dope! There are a couple edge cases I want to make sure get covered* before I publish a new version but I'm good to merge this.

* totally could have been an issue with the existing implementation but I just found them poking around with this changeset

@marcdel marcdel merged commit 1264277 into marcdel:main May 3, 2023
@leggebroten
Copy link
Contributor Author

You're welcome.
Was a fun project

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