Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Calls from the rails console never seem to get sent, but calls in the app servers work #52

Closed
barmstrong opened this Issue · 7 comments

3 participants

@barmstrong

Title pretty much describes it. If I call Librato.increment from the production rails console, no data gets sent. Not sure if this intended or not, but might be worth mentioning as it is a gotcha during first run testing. And it implies the data would not get sent from rake tasks either?

Is there a way to enable it in the console/rake tasks? Or maybe this is a job for the https://github.com/librato/librato-metrics gem? Thanks.

@nextmat
Owner

Ah yes, this is intended behavior. The reporting thread intentionally isn't started when you start up in console or test mode, I should probably make that more clear in the docs.

As for use in rake tasks and worker processes, right now using librato-metrics for more manual submission is probably the best option although we intend to provide more drop-in support for that kind of thing in librato-rails in the future.

@nextmat nextmat closed this
@barmstrong

Ok interesting. Yeah would make sense to add to the docs. And also probably to be able to set an environment variable or something to turn it on in consoles/rake tasks. Thanks!

@nextmat
Owner

Been thinking a little more about this. What's the use case you see for submission in a console session?

@barmstrong
@barmstrong

Btw, would also be cool to instrument background workers (we use Resque for this). Seeing how many of a certain job have been run, how long they are taking etc.

@kaspergrubbe

Yeah, it could be nice to use this gem in Resque. And it could be nice to use in the console, maybe also just to debug.

@nextmat
Owner

We do intend to add better resque support, monitor #8 for that - it will be a focus after we finish refactoring some of the internals. Just opened #59 for docs on manually submitting on console mode.

I believe you can currently call Librato::Rails.flush to manually submit the queued metrics, but this part of the interface is not stable and will be changing shortly so I would beware coding it into your worker processes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.