atlas redis plugin typo cleanup and better exception handling
This commit is contained in:
parent
f803fab413
commit
113c9dd657
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
.. moduleauthor:: Jay Zarfoss
|
.. moduleauthor:: Jay Zarfoss
|
||||||
"""
|
"""
|
||||||
from time import time
|
|
||||||
from redis import Redis
|
from redis import Redis
|
||||||
import json
|
import json
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
@ -27,7 +27,7 @@ def millis_since_epoch():
|
||||||
|
|
||||||
class AtlasMetricRedisPlugin(MetricPlugin):
|
class AtlasMetricRedisPlugin(MetricPlugin):
|
||||||
title = "AtlasRedis"
|
title = "AtlasRedis"
|
||||||
slug = "atlas-metric-Redius"
|
slug = "atlas-metric-redis"
|
||||||
description = "Adds support for sending key metrics to Atlas via local Redis"
|
description = "Adds support for sending key metrics to Atlas via local Redis"
|
||||||
version = atlas.VERSION
|
version = atlas.VERSION
|
||||||
|
|
||||||
|
@ -89,9 +89,9 @@ class AtlasMetricRedisPlugin(MetricPlugin):
|
||||||
try:
|
try:
|
||||||
r = Redis(host=self.redis_host, port=self.redis_port, socket_timeout=0.1)
|
r = Redis(host=self.redis_host, port=self.redis_port, socket_timeout=0.1)
|
||||||
r.rpush('atlas-agent', json.dumps(self.metric_data))
|
r.rpush('atlas-agent', json.dumps(self.metric_data))
|
||||||
except Exception:
|
except Exception as e:
|
||||||
current_app.logger.warning(
|
current_app.logger.warning(
|
||||||
"AtlasMetricsRedis: could not post atlas metrics to AtlasRedis {host}:{port}".format(
|
"AtlasMetricsRedis: exception [{exception}] could not post atlas metrics to AtlasRedis [{host}:{port}], metric [{metricdata}]".format(
|
||||||
host=self.redis_host, port=self.redis_port
|
exception=e, host=self.redis_host, port=self.redis_port, metricdata=json.dumps(self.metric_data)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -147,7 +147,7 @@ setup(
|
||||||
'java_keystore_export = lemur.plugins.lemur_jks.plugin:JavaKeystoreExportPlugin',
|
'java_keystore_export = lemur.plugins.lemur_jks.plugin:JavaKeystoreExportPlugin',
|
||||||
'openssl_export = lemur.plugins.lemur_openssl.plugin:OpenSSLExportPlugin',
|
'openssl_export = lemur.plugins.lemur_openssl.plugin:OpenSSLExportPlugin',
|
||||||
'atlas_metric = lemur.plugins.lemur_atlas.plugin:AtlasMetricPlugin',
|
'atlas_metric = lemur.plugins.lemur_atlas.plugin:AtlasMetricPlugin',
|
||||||
'atlas_metric_redis = lemur.plugins.lemur_atlas.plugin:AtlasMetricRedisPlugin',
|
'atlas_metric_redis = lemur.plugins.lemur_atlas_redis.plugin:AtlasMetricRedisPlugin',
|
||||||
'kubernetes_destination = lemur.plugins.lemur_kubernetes.plugin:KubernetesDestinationPlugin',
|
'kubernetes_destination = lemur.plugins.lemur_kubernetes.plugin:KubernetesDestinationPlugin',
|
||||||
'cryptography_issuer = lemur.plugins.lemur_cryptography.plugin:CryptographyIssuerPlugin',
|
'cryptography_issuer = lemur.plugins.lemur_cryptography.plugin:CryptographyIssuerPlugin',
|
||||||
'cfssl_issuer = lemur.plugins.lemur_cfssl.plugin:CfsslIssuerPlugin',
|
'cfssl_issuer = lemur.plugins.lemur_cfssl.plugin:CfsslIssuerPlugin',
|
||||||
|
|
Loading…
Reference in New Issue