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

Augmenting telemetry metrics metadata with process information #28

Open
josevalim opened this issue Mar 14, 2019 · 5 comments
Open

Augmenting telemetry metrics metadata with process information #28

josevalim opened this issue Mar 14, 2019 · 5 comments

Comments

@josevalim
Copy link
Contributor

Sometimes people may want to send their metrics based on some parameter that is external to the metric. For example, multi-tenant applications may want to segregate their data in someway.

Generally speaking, the way to do this is by attaching some metadata in the process dictionary. We could do our own book keeping on telemetry but maybe the simplest approach is to have something like :logger_metadata that retrieves the data from Erlang's logger and automatically adds it to the metric?

I am not sure this is the best way to go (especially because it is not decided yet if Elixir will merge its metadata with Erlang's) but I thought I would open this up for discussion.

@josevalim josevalim changed the title Augmenting telemetry metrics metadata Augmenting telemetry metrics metadata with process information Mar 14, 2019
@arkgil
Copy link
Contributor

arkgil commented Mar 15, 2019

automatically adds it to the metric

Do you mean adding it to the set of avaialble tags, i.e. merging it with event metadata?

@josevalim
Copy link
Contributor Author

josevalim commented Mar 15, 2019 via email

@arkgil
Copy link
Contributor

arkgil commented Mar 15, 2019

I'm only wondering what happens if the same key is found in both event metadata and logger_tags - which one should tak precedence? IMO logger_tags should override metadata, because if we want to rely on the procdict, we usually also control it, so we can always rename the key so that there are no conflicts.

@josevalim
Copy link
Contributor Author

josevalim commented Mar 15, 2019 via email

@tsloughter
Copy link

Hm, I've considered using logger metadata for opencensus tags, maybe we should. I think the main reason to not was that span context doesn't fit well in logger metadata. We set logger metadata for each span context but formatted to what you'd expect in logs, not the actual span context record which has integers not strings. So we are messing with the pdict anyway. But for tags it may make sense to just use logger metadata, especially if telemetry_metrics will want to grab from there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants