libsolace.plugins.InfluxDBClient module¶
Simple influxdb client that can send metrics to influx.
PLUGINS:
...
- libsolace.plugins.InfluxDBClient
...
INFLUXDB_HOST: localhost
INFLUXDB_PORT: 8086
INFLUXDB_USER: user
INFLUXDB_PASS: pass
INFLUXDB_DB: solace
-
libsolace.plugins.InfluxDBClient.
InfluxDBClient
(fn)[source]¶ Simple influxdb client plugin for libsolace
Example:
>>> import libsolace.settingsloader as settings >>> import libsolace >>> metrics_class = libsolace.plugin_registry('InfluxDBClient', settings=settings) >>> metrics = metrics_class(settings=settings)
-
libsolace.plugins.InfluxDBClient.
flatten_json
(y)[source]¶ flattens a json object combining key names to be {parent-child-leaf: value}
Parameters: y – Returns:
-
class
libsolace.plugins.InfluxDBClient.
InfluxDBClient
[source] Simple influxdb client plugin for libsolace
Example:
>>> import libsolace.settingsloader as settings >>> import libsolace >>> metrics_class = libsolace.plugin_registry('InfluxDBClient', settings=settings) >>> metrics = metrics_class(settings=settings)
-
plugin_name
= 'InfluxDBClient'¶
-
send
(measurement, data, **tags)[source]¶ Sends the metrics to influxdb.
Examples:
>>> import libsolace.settingsloader as settings >>> import libsolace >>> metrics_class = libsolace.plugin_registry('InfluxDBClient', settings=settings) >>> metrics = metrics_class(settings=settings)
>>> metrics.send('http-metrics', {"key": 10, "key2": 12}, environment='prod', host='foo') >>> metrics.send("test", {"key": 2}, host="test")
Parameters: - data – a json object of keys and values. will be flattened!
- measurement –
-