Skip to content
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

Filtering metrics with Clojure functions #105

Open
danielcompton opened this issue Jun 19, 2016 · 6 comments
Open

Filtering metrics with Clojure functions #105

danielcompton opened this issue Jun 19, 2016 · 6 comments
Labels

Comments

@danielcompton
Copy link
Member

We're using Hosted Graphite (great service btw), and we are charged by our metric count. We have ring metrics, JVM metrics, and custom metrics and are going over our cap. I'd like to filter some of the ring metrics as we only need a few from here, but it's not clear if/how to do that? I read the docs on removing metrics, but it seemed like they would just be recreated later.

What's the recommended way of filtering the metrics that get sent to a (graphite) reporter?

@michaelklishin
Copy link
Collaborator

You can either

  • Remove metrics and not collect them (so that they do not get recreated)
  • Develop a custom reporter (a Java interface implementation)

I'm not aware of a way to filter out metrics in reporters other than duplicating the entire metric registry and removing some keys right before sending the data.

@michaelklishin
Copy link
Collaborator

By the way, I am open to ideas about how to address this but I'm afraid this specific library is largely at the mercy of a feature provided in Dropwizard Metrics. Unless we want to subclass every single reporter, at least.

@michaelklishin michaelklishin changed the title Filtering metrics? Filtering metrics with Clojure functions Jun 21, 2016
@michaelklishin
Copy link
Collaborator

Actually, there is MetricFilter which can be passed in but there is no way to define one as a Clojure function.

@danielcompton
Copy link
Member Author

When you say "passed in", where is it passed?

@michaelklishin
Copy link
Collaborator

To functions that instantiate metric reporters.

@danielcompton
Copy link
Member Author

Awesome, I'll take a look at this. If it works well, I'll put together a PR to make it more Clojure native.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants