Open shengwu opened 7 years ago
Hi @shengwu, unfortunately tags are not supported when updating a metric. However you would be able to do to this by using exometer_core
directly and writing a :exometer_probe
with a version of :exometer_slide
that supports tagging values. While this may seem very complex, I do not think it would be as difficult as it sounds because exometer_core
contains a few examples of how do this, and the hardest parts can be copied from the existing :exometer_spiral
and :exometer_slide
.
Note that this would lose you the automatic creation/subscribing of metrics and thepobox
protection that elixometer
provides to prevent overloading a :exometer_probe
process. However again elixometer
also exposes enough to replicate this feature if you require it.
@fishcakez Thank you for responding so quickly! Glad to hear that it's possible with exometer.
By chance, would elixometer be open to a contribution adding this feature?
I'm not immediately sure about this. Likely adding a tagged spiral would double the size of the code base 😨. It might be preferable for elixometer to support custom metrics, similar to the update or create feature of exometer.
On 26 Aug 2017 3:29 pm, "Sheng Wu" notifications@github.com wrote:
@fishcakez https://github.com/fishcakez Thank you for responding so quickly! Glad to hear that it's possible with exometer.
By chance, would elixometer be open to a contribution adding this feature?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pinterest/elixometer/issues/92#issuecomment-325165377, or mute the thread https://github.com/notifications/unsubscribe-auth/AB6JTfaaYw4RGxkm3B9nAxIgFjkky-OBks5scJxigaJpZM4PDky8 .
I have a fork https://github.com/Zorbash/exometer/commit/ac6197b203258efe696b54c33e1ceb002eb09e38 which supports DataDog tags from configuration. I think that maybe exometer_report_statsd.erl can be changed to support dynamic (per metric update) tags.
How would you express the goal to capture response time metrics along with status code with elixometer
? Have a unique metric for each status code?
The information I would get is what response time is
and how many and what errors are there
?
Can I answer the second question with elixometer?
Thanks
Actually, the exometer_influxdb reporter already supports a feature to convert a chunk of metric as a tag: https://github.com/travelping/exometer_influxdb/issues/3
Someone might find this helpful, so I'm still posting the comment
We are planning to use elixometer to send metrics to datadog (with exometer_datadog). I know it's possible with some of datadog's libraries to set tags on metrics. For example, the
my_app_api_endpoint
metric could have astatus_code
tag to record what code the method returned, amethod
tag to record what the HTTP method was, and anendpoint
tag to record the endpoint.Is there a way to record tags when updating a metric, maybe with optional parameters in a call like
update_spiral("metrics_test.\#{thingie}.qps", 1)
? I looked through the source code, but it was not obvious whether this is supported.