Datadog formatter - Convert tag value of list to multiple tag values with same key #90
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
To give some context, datadog supports receiving multiple tag values with the same key, so you could have a dogstatsd datagram such as:
There's some work that I'm involved with on migrating an elixir application from https://hexdocs.pm/statix/Statix.html to use the telemetry module and this library for recording telemetry, and sending them to datadog. statix supported a list of tags, which could be ["tag1:value", "tag1:secondvalue", "tag2"].
With the telemetry module and telemetry_metrics_statsd, we can send a telemetry metric with metadata such as:
The reason list is being converted to a string by the datadog formatter, and then the datagram looks like:
The main downside of that is that in datadog dashboards, the reason field is one string, so it's not as clean looking. When you have multiple tag values, you can do queries on reason:reason1, compared to now doing a string search of reason:reason1. As well, when displaying a table of the tag, it will show up as reason1, reason2 automatically if there's multiple tag values.
The changes in this pull request detect a list and then take each item in the list as a new tag value so the datagram looks like the first example of
If these changes shouldn't be the default, it could also be put behind a config parameter when setting up TelemetryMetricsStatsd