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

allow disabling statsd #16

Closed
Dieterbe opened this issue Jun 11, 2012 · 1 comment
Closed

allow disabling statsd #16

Dieterbe opened this issue Jun 11, 2012 · 1 comment

Comments

@Dieterbe
Copy link
Collaborator

use case:
a node app implements statsd metrics sending using this library.
user of this node app wants to configure his app so that it doesn't do any statsd sending.

i see 3 ways to implement this:

  • everywhere the app does calls on the client, wrap in disabled/enabled check (ugly)
  • app provides wrapper functions around library to wrap all calls in disabled/enabled check (still a bit ugly)
  • node-statsd doesn't do any statsd sending if the Client has this.host unset, or empty or null or whatever. (nice!)

the only thing needed to make this work is an edit in the Client.prototype.send function. I'm willing to create a patch for this, but since there's a bunch of socket-related changes pending, I would wait until that settles down.

@devdazed
Copy link
Collaborator

devdazed commented Feb 8, 2013

You should be able to accomplish this by setting the sample rate to -1. In this case the user would set a variable where the sample rate is either 1 or -1. When they want to turn it off they set it to -1 and it will never pass.

humphd added a commit to humphd/node-statsd that referenced this issue Mar 15, 2013
devdazed added a commit that referenced this issue Mar 27, 2013
Add StatsDNull client. Closes #16.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants