heroku-buildpack-datadog icon indicating copy to clipboard operation
heroku-buildpack-datadog copied to clipboard

Is integration with Heroku add-ons possible to collect data from them?

Open imochurad opened this issue 7 years ago • 7 comments

I have a java Heroku app that is utilizing a bunch of other services (Heroku add-ons). Like Redis, Cassandra, Kafka to name a few and I wanted to use Data Dog to collect health metrics and configure alerts if there are signs that my app becomes unhealthy. With your build pack, is that possible to configure integrations with the mentioned above add-ons? If so, could you please provide some details and/or examples? Reply would be appreciated.

imochurad avatar Sep 29 '16 19:09 imochurad

Hello @imochurad !

As can be seen in the startup script we run a specialized version of one of the Agent's components - the statsd listener - to allow apps to emit statsd messages to be sent to the platform.

This approach doesn't run the Agent as a collector for other sources like external databases - this would likely involve a more complex configuration and process runner approach. This might be something valuable for a standalone Dyno, not so applicable to a buildpack that is part of the application layer.

miketheman avatar Sep 29 '16 21:09 miketheman

An alternative approach would be to setup a log drain for your app that parses runtime-metric logs and forwards them to Datadog.

tatey avatar Sep 29 '16 22:09 tatey

@tatey Cool idea! I don't see if the runtime-metrics provide insight into the add-ons, can you share how that's done?

miketheman avatar Sep 29 '16 23:09 miketheman

If you're using the standard or premium tiers of Postgres and Redis you should see log entries for these addons in your app logs. I am not sure about Kafka, but given it's now a first class on Heroku, I imagine it's similar.

  • https://devcenter.heroku.com/articles/heroku-postgres-metrics-logs
  • https://devcenter.heroku.com/articles/heroku-redis-metrics-logs

tatey avatar Sep 30 '16 10:09 tatey

I actually open sourced an implementation of this idea last week in Ruby. It uses this very buildpack, so thanks!

tatey avatar Sep 30 '16 10:09 tatey

@tatey how do you parse a log drain?

imochurad avatar Sep 30 '16 17:09 imochurad

@imochurad Heroku have a pretty good article on how Log Drains work.

tatey avatar Sep 30 '16 23:09 tatey