-
Notifications
You must be signed in to change notification settings - Fork 39
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
Allow specifying tags for metrics #6
Comments
This is in the plans but I haven't had time to work on it yet. I'd like a design where creating e.g. a counter indexed by N dimensions (e.g. integers and strings) can be done in a type safe manner i.e. once the counter is created calling data Dim = T Text | I Int
newCounter :: [Dim] -> IO Counter
inc :: Counter -> [Dim] -> IO () I was thinking of using e.g. a phantom type to track the dimensions for a given counter by using a more untyped representation internally. Needs some thought. |
Interesting idea. Keep me posted! |
Just saw this issue, was replying on #12 (comment) that I've started a patch. I'll fix ekg-json soon (very likely adding a key to the ToJSON instance), then ekg will take me more work (in particular, the HTML+JS rendering). Then, we can imagine a typeful API using typelevel strings or a typeclass to add a variable number of arguments. This typeful API could live in another package. I'm still unsure whether we should add a hashmap-like interface to "manage" counters for points using new dimensional breakdowns. In particular, there's a risk to have an unbounded number of counters growth if library users do not pay attention + I don't like exposing a lookupOrCreate function when I often use counters in tight-loops on-the-fly -- imho, such a lookupOrCreate function should live in another package. |
OpenTSDB - the time series database used by bosun - uses a different naming convention than EKG. Metrics have an arbitrary name, but they also have a list of key-value pairs (tags). The idea is that you can now have more general metrics such as
http.response_time
, and then tag data points with specific information such asroute=/api/list-foos
.I wonder if EKG should support such a thing, or if I should add support for "post-processing" metrics to ekg-bosun -
postProcess :: Name -> (Name, [Tag])
, or something to that effect.Thoughts?
The text was updated successfully, but these errors were encountered: