-
Notifications
You must be signed in to change notification settings - Fork 106
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
Filter per metric and expansion #83
Comments
Thanks for the write up, @fabienrenaud ! Could you better state your motivation for this request? As stated, I don't see a big benefit in filtering In any case, it's unlikely I'll personally have any time to work on this in the next couple months. PRs are welcome, of course. The codebase is fairly well-test and readable IMO :) |
Datadog pricing is the issue where I work. Every VM or container is allocated a certain number of unique metrics (including tags!). Dropwizard produces so many metrics out of the box that we're nearly over budget before adding any metrics of our own. |
A possible solution one can use is implementing a Transport class that wraps another Transport (& Request implementation) and only forwards the addGauge/addCounter when the metric name fits whatever requirements you define. The metric names at that point are fully expanded. We use this for precisely the reasons @qualidafial mentioned - to reduce the amount of DataDog metrics we report from each JVM. e.g.:
A bit on the hacky side, but it's simple and it works. |
@adamhonen you can already restrict the metric suffixes with the |
Example config: metrics:
reporters:
- type: datadog
expansions:
- COUNT
- MEAN
- MEDIAN
- P99 |
Yeah, I guess my example is simple enough that it could be handled that way. |
I agree. I think I'd prefer a solution that used the existing |
So.. it looks like this is already provided by dropwizard-metrics: metrics:
reporters:
- type: datadog
expansions:
- COUNT
- MEAN
- MEDIAN
- P99
useRegexFilters: true
includes:
- "myapp.*"
- "jvm\\.attribute\\.uptime.*"
- "jvm\\.gc.*"
- "jvm\\.memory.*"
excludes:
- "jvm\\.memory\\.pools.*" The include and excludes are matched against the entire metric name (including tags), so you want to add a |
metric-datadog allows filtering metrisc by name using a
MetricFilter
. This feature should be extended to allow filtering of expansions per metric.Example
The reporter will send to datadog:
However,
httpRequests.count
is unnecessary since i can get that count by summing the counts of all resCodes meters (and do that in datadog).MetricFilter
only provides filtering by names defined in the metrics API. It would be more convenient to filter by metric name that will be sent to datadog (just before sending it). Filtering by tag could also be more powerful if the filtering is done near the end of the funnel.The text was updated successfully, but these errors were encountered: