goboundless / heroku_postgres_monitor Goto Github PK
View Code? Open in Web Editor NEWHeroku app wrapper for newrelic_postgres_plugin. Send metrics from your Heroku Postgres instances to the NewRelic Platform.
Heroku app wrapper for newrelic_postgres_plugin. Send metrics from your Heroku Postgres instances to the NewRelic Platform.
Hi there,
I'm having trouble getting this to work. I followed the instructions with the exception that I prefixed the database url with "postgres://" in order to get the URI parsed correctly in config/newrelic_plugin.yml. I don't see any db metrics in my New Relic dashboards and no errors in the heroku log. I'm probably missing something, do I need to do any special in New Relic, like setting up a custom dashboard?
Thanks
/Karl
Any ideas why this plugin is failing? Thanks for any assistance you can provide.
root@prdpostdb01:/opt/newrelic/postgres# ruby -v
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux]
root@prdt13postdb01:/opt/newrelic/postgres# gem list
*** LOCAL GEMS ***
bundler (1.3.5)
bundler-unload (1.0.2)
dotenv (0.9.0)
executable-hooks (1.2.1)
foreman (0.63.0)
json (1.8.0)
newrelic_plugin (1.2.1)
newrelic_postgres_plugin (0.1.6)
pg (0.17.0)
rake (10.1.0)
rubygems-bundler (1.3.2)
rvm (1.11.3.8)
thor (0.18.1)
root@prdpostdb01:/opt/newrelic/postgres# pg_monitor run
[2013-09-23 15:54:19 UTC] INFO: Using Ruby SDK version: 1.2.1
/usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/newrelic_plugin-1.2.1/lib/newrelic_plugin/agent.rb:91:in initialize': wrong number of arguments (3 for 1..2) (ArgumentError) from /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/newrelic_postgres_plugin-0.1.6/lib/newrelic_postgres_plugin/agent.rb:29:in
initialize'
from /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/newrelic_plugin-1.2.1/lib/newrelic_plugin/setup.rb:37:in new' from /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/newrelic_plugin-1.2.1/lib/newrelic_plugin/setup.rb:37:in
create_agent'
from /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/newrelic_plugin-1.2.1/lib/newrelic_plugin/run.rb:81:in block (2 levels) in setup_from_config' from /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/newrelic_plugin-1.2.1/lib/newrelic_plugin/run.rb:77:in
each'
from /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/newrelic_plugin-1.2.1/lib/newrelic_plugin/run.rb:77:in block in setup_from_config' from /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/newrelic_plugin-1.2.1/lib/newrelic_plugin/run.rb:73:in
each'
from /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/newrelic_plugin-1.2.1/lib/newrelic_plugin/run.rb:73:in setup_from_config' from /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/newrelic_plugin-1.2.1/lib/newrelic_plugin/run.rb:12:in
setup_and_run'
from /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/newrelic_postgres_plugin-0.1.6/lib/newrelic_postgres_plugin/agent.rb:16:in run' from /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/newrelic_postgres_plugin-0.1.6/bin/pg_monitor:43:in
<top (required)>'
from /usr/local/rvm/gems/ruby-2.0.0-p247@global/bin/pg_monitor:23:in load' from /usr/local/rvm/gems/ruby-2.0.0-p247@global/bin/pg_monitor:23:in
eval' from /usr/local/rvm/gems/ruby-2.0.0-p247@global/bin/ruby_executable_hooks:14:in
'
root@prdpostdb01:/opt/newrelic/postgres# cat config/newrelic_plugin.yml
newrelic:
license_key: '*********'
verbose: 1
agents:
postgres:
host: 'prdpostdb01.ourdomain.com'
port: 5432
user: '_'
password: '******'
dbname: '**_*******'
sslmode: 'disable' # (disable|allow|prefer|require)
label: 'Production DB' # This label is optional and will default to the server hostname - it shows up in the NewRelic Web UI
Do we need to upgrade?
Hello-
I am using the heroku deployed version. It appears to be working fine to poll PG, but doesn't show up as a tab in newrelic, and seems like it may be failing posting to it.
Here is a log snip. Every run has the same error.
2014-04-29T02:35:45.171433+00:00 app[worker.1]: [2014-04-29 02:34:45 UTC] DEBUG: JSON payload: {"agent":{"version":"0.1.10"},"components":[{"name":"DATABASE, HEROKU_POSTGRESQL_CYAN","guid":"com.boundless.postgres","duration":60,"metrics":{"Component/Backends/Active[connections]":[19.0,19,1.0,1.0,19.0],"Component/Backends/Idle[connections]":[0.0,19,0.0,0.0,0.0],"Component/Background Writer/Checkpoints/Scheduled[checkpoints]":[0.0,19,0.0,0.0,0.0],"Component/Background Writer/Checkpoints/Requested[checkpoints]":[0.0,19,0.0,0.0,0.0],"Component/Database/Backends[]":[19.0,19,1.0,1.0,19.0],"Component/Database/Transactions/Committed[]":[128.0,19,0.0,9.0,914.0],"Component/Database/Transactions/Rolled Back[]":[0.0,19,0.0,0.0,0.0],"Component/Database/Tuples/Read from Disk[]":[75.0,19,0.0,75.0,5625.0],"Component/Database/Tuples/Read Cache Hit[]":[17422.0,19,0.0,1024.0,16871188.0],"Component/Database/Tuples/Returned/From Sequential[]":[31919.0,19,0.0,2628.0,57374777.0],"Component/Database/Tuples/Returned/From Bitmap[]":[9749.0,19,0.0,552.0,5280281.0],"Component/Database/Tuples/Writes/Inserts[]":[0.0,19,0.0,0.0,0.0],"Component/Database/Tuples/Writes/Updates[]":[0.0,19,0.0,0.0,0.0],"Component/Database/Tuples/Writes/Deletes[]":[0.0,19,0.0,0.0,0.0],"Component/Database/Conflicts[]":[0.0,19,0.0,0.0,0.0],"Component/Indexes/Number of Indexes[indexes]":[2128.0,19,112.0,112.0,238336.0],"Component/Indexes/Index Hit Rate[%]":[0.0,19,0.0,0.0,0.0],"Component/Indexes/Cache Hit Rate[%]":[0.0,19,0.0,0.0,0.0],"Component/Indexes/Size on Disk[bytes]":[51363840.0,19,2703360.0,2703360.0,138854950502400.0]}}]}
2014-04-29T02:35:45.171434+00:00 app[worker.1]: [2014-04-29 02:34:45 UTC] ERROR: FAILED[400] https://platform-api.newrelic.com/platform/v1/metrics: no data returned
Hi @mhodgson ,
Nice plugin.
I see only part of the metrics, in the new relic interface. But report_metric
is sending everything needed to NewRelic.
Any ideas why ?
thanks
Can't deploy cause of an error occurred while installing Ruby ruby-2.1.0.
The new cedar need a newer runtime --> 2.1.5
See: https://devcenter.heroku.com/articles/ruby-support#supported-runtimes
I leave a PR
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.