brightcove / hot-shots

Node.js client for statsd, DogStatsD, and Telegraf

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add tags on asyncTimer during function execution

Ashniu123 opened this issue · comments

Hi

I have a scenario where I want to add tags to the asyncTimer stat with data which is fetched during the function execution. Is there a way to do that with hot-shots?

I use datadog for metric collection. Their dd-trace library has the capability to do so with tracer.scope().active()?.addTags(...). Could hot-shots have something similar?

It doesn't look like that is something you can do: https://github.com/brightcove/hot-shots/blob/master/lib/statsFunctions.js#L67

Your choices here would be to add something (PRs always welcome) or to take this code into your own code and alter, as it's syntactic sugar on top of the timing() function.