librato / statsd-librato-backend

A StatsD backend that sends metrics to Librato Metrics
MIT License
76 stars 34 forks source link

Backend logging all by default #87

Closed elblivion closed 7 years ago

elblivion commented 7 years ago

Hi,

We're deploying statsd in Kubernetes, and logging to stdout. We currently get everything in our logs, including "DEBUG" messages, e.g. https://github.com/librato/statsd-librato-backend/blob/master/lib/librato.js#L64-L66.

Our config does not set the debug value in statsd, it seems something is forcing this logAll to be true - could you please help us out?

Thanks!

{
  librato: {
    email: process.env.LIBRATO_EMAIL,
    token: process.env.LIBRATO_TOKEN,
    host: false,
    tags: {
      cluster: process.env.CLUSTER_NAME,
      environment: process.env.CLUSTER_ENVIRONMENT
    }
  },
  backends: ['statsd-librato-backend'],
  percentThreshold: [95, 99],
  port: 8125,
  deleteIdleStats: true,
  keyNameSanitize: false
}
bryanmikaelian commented 7 years ago

👋 Hmm... I know logAll will get set to true if a logger is set when the backend is initialized. Could that be what you are seeing? https://github.com/librato/statsd-librato-backend/blob/master/lib/librato.js#L467-L471

~We should definitely get this documented since our README makes no mention of it. cc @niklibrato~ config.debug is actually a statsd config option. Maybe we still document it?

elblivion commented 7 years ago

I'm not really proficient in Javascript, but that seems to be the case. What should we do if we want to not logAll?

bryanmikaelian commented 7 years ago

It seems like we should honor config.debug, regardless if you have a statsd logger configured or not. The alternative is to remove your logger from your statsd instance which...isn't ideal.

I'll get a PR opened to fix this.

elblivion commented 7 years ago

Thanks!