From f4aab203317b4f337e53d9531b81d69305e0d3a3 Mon Sep 17 00:00:00 2001 From: josh Date: Sun, 19 Apr 2015 05:03:16 -0700 Subject: [PATCH 1/3] read licensekey from environment, else fallback to reading from configuration file --- newrelic_plugin_agent/agent.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/newrelic_plugin_agent/agent.py b/newrelic_plugin_agent/agent.py index 5ba78ec..39d5a8c 100644 --- a/newrelic_plugin_agent/agent.py +++ b/newrelic_plugin_agent/agent.py @@ -85,7 +85,8 @@ def license_key(self): :rtype: str """ - return self.config.application.license_key + licensekey = os.getenv('NEWRELIC_LICENSE_KEY', self.config.application.license_key) + return licensekey def poll_plugin(self, plugin_name, plugin, config): """Kick off a background thread to run the processing task. From e367112f91da1b4cd568212150a437baacd5853c Mon Sep 17 00:00:00 2001 From: josh Date: Sun, 19 Apr 2015 05:20:29 -0700 Subject: [PATCH 2/3] read licensekey from environment first --- newrelic_plugin_agent/agent.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/newrelic_plugin_agent/agent.py b/newrelic_plugin_agent/agent.py index 39d5a8c..cc2c621 100644 --- a/newrelic_plugin_agent/agent.py +++ b/newrelic_plugin_agent/agent.py @@ -85,7 +85,9 @@ def license_key(self): :rtype: str """ - licensekey = os.getenv('NEWRELIC_LICENSE_KEY', self.config.application.license_key) + licensekey = os.getenv('NEWRELIC_LICENSE_KEY') + if licensekey==None: + licensekey = self.config.application.license_key return licensekey def poll_plugin(self, plugin_name, plugin, config): From 5f1ec79094815486d26bc66a55b5ff1d1e97b6c7 Mon Sep 17 00:00:00 2001 From: josh Date: Sun, 19 Apr 2015 05:37:02 -0700 Subject: [PATCH 3/3] catch postgres replication status error --- newrelic_plugin_agent/plugins/postgresql.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/newrelic_plugin_agent/plugins/postgresql.py b/newrelic_plugin_agent/plugins/postgresql.py index a16aab8..52ac0f3 100644 --- a/newrelic_plugin_agent/plugins/postgresql.py +++ b/newrelic_plugin_agent/plugins/postgresql.py @@ -90,7 +90,10 @@ def add_stats(self, cursor): self.add_index_stats(cursor) self.add_statio_stats(cursor) self.add_table_stats(cursor) - self.add_replication_stats(cursor) + try: + self.add_replication_stats(cursor) + except: + LOGGER.exception("error retrieving replication status") self.add_transaction_stats(cursor) # add_wal_metrics needs superuser to get directory listings