MeetMe / newrelic-plugin-agent

Multi-Plugin python-based Agent for NewRelic's Platform
BSD 3-Clause "New" or "Revised" License
425 stars 265 forks source link

pgbouncer key error pools #509

Closed boskiv closed 7 years ago

boskiv commented 7 years ago
admin_users = postgres, newrelic
stats_users = stats, postgres, newrelic
pgbouncer:
    host: localhost
    port: 6432
    user: newrelic
    database: postgres
INFO       2016-11-16 12:32:01,695 17556  MainProcess     MainThread newrelic_plugin_agent.agent                   start_plugin_polling      L263   : Enabling plugin: pgbouncer
Traceback (most recent call last):
  File "/bin/newrelic-plugin-agent", line 9, in <module>
    load_entry_point('newrelic-plugin-agent==1.3.0', 'console_scripts', 'newrelic-plugin-agent')()
  File "/usr/lib/python2.7/site-packages/newrelic_plugin_agent/agent.py", line 337, in main
    helper.start(NewRelicPluginAgent)
  File "/usr/lib/python2.7/site-packages/helper/__init__.py", line 174, in start
    obj.start()
  File "/usr/lib/python2.7/site-packages/helper/controller.py", line 266, in start
    self.run()
  File "/usr/lib/python2.7/site-packages/helper/controller.py", line 253, in run
    self.process()
  File "/usr/lib/python2.7/site-packages/newrelic_plugin_agent/agent.py", line 118, in process
    self.start_plugin_polling()
  File "/usr/lib/python2.7/site-packages/newrelic_plugin_agent/agent.py", line 280, in start_plugin_polling
    self.config.application.get(plugin))
  File "/usr/lib/python2.7/site-packages/newrelic_plugin_agent/agent.py", line 108, in poll_plugin
    thread.run()
  File "/usr/lib64/python2.7/threading.py", line 764, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib/python2.7/site-packages/newrelic_plugin_agent/agent.py", line 308, in thread_process
    obj.poll()
  File "/usr/lib/python2.7/site-packages/newrelic_plugin_agent/plugins/postgresql.py", line 266, in poll
    self.add_stats(cursor)
  File "/usr/lib/python2.7/site-packages/newrelic_plugin_agent/plugins/pgbouncer.py", line 73, in add_stats
    cursor.execute('SHOW %s' % key)
  File "/usr/lib64/python2.7/site-packages/psycopg2/extras.py", line 120, in execute
    return super(DictCursor, self).execute(query, vars)
psycopg2.ProgrammingError: unrecognized configuration parameter "pools"

pip freeze

[root@D3065:0 newrelic]# pip freeze
backports.ssl-match-hostname==3.4.0.2
boto==2.39.0
chardet==2.2.1
configobj==4.7.2
decorator==3.4.0
duplicity==0.7.10
ecdsa==0.11
GnuPGInterface==0.3.2
helper==2.4.2
iniparse==0.4
iotop==0.6
IPy==0.75
kitchen==1.1.1
lockfile==0.9.1
newrelic-plugin-agent==1.3.0
paramiko==1.15.1
pexpect==2.3
pg-activity==1.2.0
policycoreutils-default-encoding==0.1
psutil==2.2.1
psycopg2==2.6.1
pyasn1==0.1.6
pycrypto==2.6.1
pycurl==7.19.0
pygobject==3.14.0
pygpgme==0.3
pyliblzma==0.5.3
pyudev==0.15
pyxattr==0.5.1
PyYAML==3.12
requests==2.6.0
rsa==3.3
seobject==0.1
sepolicy==1.1
six==1.9.0
slip==0.4.0
slip.dbus==0.4.0
SSSDConfig==1.13.0
urlgrabber==3.10
urllib3==1.10.2
yum-metadata-parser==1.1.4
[ivan.skiridomov@D3065:0 ~]$ psql -p 6432 pgbouncer -U newrelic
Password for user newrelic: 
psql (9.3.11, server 1.7.2/bouncer)
Type "help" for help.

pgbouncer=# SHOW POOLS;
   database    |       user        | cl_active | cl_waiting | sv_active | sv_idle | sv_used | sv_tested | sv_login | maxwait |  pool_mode  
---------------+-------------------+-----------+------------+-----------+---------+---------+-----------+----------+---------+-------------
 authenticator | authenticator_rw  |        20 |          0 |         0 |       1 |       0 |         0 |        0 |       0 | transaction
 crm_data_feed | crm_data_feed_rw  |         4 |          0 |         1 |       0 |       0 |         0 |        0 |       0 | transaction
 hft_db        | hft_ro_user       |         0 |          0 |         0 |       0 |       0 |         0 |        0 |       0 | transaction
 intranet      | intranet_rw       |         0 |          0 |         0 |       0 |       0 |         0 |        0 |       0 | transaction
 mapper        | alexey.artamoshin |         2 |          0 |         0 |       1 |       0 |         0 |        0 |       0 | transaction
 mapper        | crm_data_feed_ro  |         0 |          0 |         0 |       0 |       0 |         0 |        0 |       0 | transaction
 mapper        | mapper_ro         |         0 |          0 |         0 |       0 |       0 |         0 |        0 |       0 | transaction
 mapper        | mapper_rw         |        40 |          0 |         0 |       0 |       0 |         0 |        0 |       0 | transaction
 newrelic      | newrelic          |         0 |          0 |         0 |       0 |       0 |         0 |        0 |       0 | transaction
 pavel         | crm_data_feed_ro  |         4 |          0 |         0 |       1 |       0 |         0 |        0 |       0 | transaction
 pavel         | exness.monitoring |         0 |          0 |         0 |       0 |       0 |         0 |        0 |       0 | transaction
 pavel         | imakarov          |         2 |          0 |         0 |       0 |       0 |         0 |        0 |       0 | transaction
 pavel         | mt_archive        |         2 |          0 |         0 |       1 |       0 |         0 |        0 |       0 | transaction
 pavel         | mtwl              |         1 |          0 |         0 |       1 |       0 |         0 |        0 |       0 | transaction
 pavel         | personal-area-rw  |        51 |          0 |         1 |       1 |       0 |         0 |        0 |       0 | transaction
 pavel         | public_pavel      |         0 |          0 |         0 |       0 |       0 |         0 |        0 |       0 | transaction
 pavel         | publics_ro        |        24 |          0 |         0 |       1 |       0 |         0 |        0 |       0 | transaction
 pavel         | publics_rw        |        34 |          0 |         3 |       2 |       0 |         0 |        0 |       0 | transaction
 personal-area | personal-area-rw  |        51 |          0 |         1 |       1 |       0 |         0 |        0 |       0 | transaction
 pgbouncer     | pgbouncer         |         1 |          0 |         0 |       0 |       0 |         0 |        0 |       0 | statement
 postgres      | alexey.artamoshin |         1 |          0 |         0 |       0 |       0 |         0 |        0 |       0 | transaction
 postgres      | imakarov          |         1 |          0 |         0 |       0 |       0 |         0 |        0 |       0 | transaction
 postgres      | newrelic          |         0 |          0 |         0 |       0 |       0 |         0 |        0 |       0 | transaction
 securitytype  | securitytype_ro   |         3 |          0 |         0 |       1 |       0 |         0 |        0 |       0 | transaction
 securitytype  | securitytype_rw   |        32 |          0 |         0 |       0 |       0 |         0 |        0 |       0 | transaction
 smsverify     | smsverify         |         0 |          0 |         0 |       1 |       0 |         0 |        0 |       0 | transaction
 stats         | crm_data_feed_ro  |         4 |          0 |         1 |       1 |       0 |         0 |        0 |       0 | transaction
 stats         | statsro           |         0 |          0 |         0 |       1 |       0 |         0 |        0 |       0 | transaction
 stats         | statsrw           |         0 |          0 |         0 |       2 |       0 |         0 |        0 |       0 | transaction
 verificator   | verificator_rw    |        40 |          0 |         0 |       1 |       0 |         0 |        0 |       0 | transaction
(30 rows)
boskiv commented 7 years ago

Changing database to pgbouncer in config file solves the issue.