eric / metriks

An experimental library to instrument ruby
MIT License
479 stars 51 forks source link

Add support for setting a metric name prefix. #24

Closed ghost closed 11 years ago

ghost commented 11 years ago

Just added support for setting a prefix on metric names. Useful when you want to group metrics by application.

Example: Metriks.set_prefix('some_app.development')

Metriks.meter('requests') # => some_app.development.requests meter

eric commented 11 years ago

The way I've considered doing this is actually by providing the prefix in the reporter instead of in the registry.

What reporter are you using right now?

ghost commented 11 years ago

Graphite

Eric Lindvall wrote:

The way I've considered doing this is actually by providing the prefix in the reporter instead of in the registry.

What reporter are you using right now?

— Reply to this email directly or view it on GitHub https://github.com/eric/metriks/pull/24#issuecomment-11106868.

ghost commented 11 years ago

Yeah, reporter might make more sense.

Eric Lindvall wrote:

The way I've considered doing this is actually by providing the prefix in the reporter instead of in the registry.

What reporter are you using right now?

— Reply to this email directly or view it on GitHub https://github.com/eric/metriks/pull/24#issuecomment-11106868.

eric commented 11 years ago

You can pass :prefix => 'some_app.development' into your graphite reporter when you initialize it:

reporter = Metriks::Reporter::Graphite.new(<options>, :prefix => 'some_app.development')

and it should give you what you need.

ghost commented 11 years ago

Ok, see the option now. Will just use that. Thanks!