Skip to content
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.

Support a SOURCE_PREFIX option #73

Open
nextmat opened this issue Aug 23, 2013 · 5 comments
Open

Support a SOURCE_PREFIX option #73

nextmat opened this issue Aug 23, 2013 · 5 comments

Comments

@nextmat
Copy link
Contributor

nextmat commented Aug 23, 2013

For users who are using the library with multiple apps on a single Librato account currently the only way to differentiate them is to use PREFIX to split them into separate metrics.

If we supported a SOURCE_PREFIX then metrics for all applications could be reported into the same metrics with different sources and users could leverage dynamic instruments to switch between them without having to build new instruments & dashboards.

@jeffblake
Copy link

Bump....

For example, I prefix all my sources by:

[environment].[process_type].server.worker

e.g.

production.web.1.10

This way I can have a single Librato account and use it for both staging and production environments.

@josephruscio
Copy link
Contributor

@jeffblake thanks for bumping this. We actually did recently add support for this through a separate gem, librato-rack-source_prefix, and neglected to update this ticket or the README.

You should be able to just add that gem and set your custom prefixes. Let us know if you need any help and I'll leave this ticket open for now as a reminder that we need to update the README.

@jeffblake
Copy link

Thanks Joseph. I came up with this shortly before your comment,

production:
  user: <%= ENV['LIBRATO_USER'] %>
  token: <%= ENV['LIBRATO_TOKEN'] %>
  source: <%= ENV['LIBRATO_SOURCE'] + '.' + ENV['DYNO'] %>

This seemed like the easiest way to take care of the automatic rails and rack instrumentation. I already wrap other calls to Librato in a small class... so I don't think I'll need librato-rack-source_prefix

@jeffblake
Copy link

In fact, it would be nice to use the librato-rack-source_prefix gem, as I use other gems that integrate Librato reporting, however it does not support the Heroku ENV['DYNO'] name. So it seems that we need another source prefix to compliment LIBRATO_SOURCE and source_pids. This way we could set

LIBRATO_SOURCE=production
LIBRATO_SERVER_PREFIX= ENV['DYNO'] = web.1 or whatever

and then are concatenated together.

edit: maybe this request is too platform specific and I am best off using my above config file to customize the source. I will still use librato-rack-source_prefix gem to compliment

@josephruscio
Copy link
Contributor

@jeffblake thanks for the feedback. I'll check in with @bdehamer next week on the best way to support Heroku with this :)

@bdehamer bdehamer removed their assignment Aug 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants