You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There will now be a Graphite-API running on ``localhost:8000`` from the container with a default InfluxDB configuration and memcache enabled. Finder expects InfluxDB to be running on ``localhost:8086`` by default.
55
55
56
-
To use a modified Graphite-API config either build a new image from ``ikuosu/influxgraph`` with a ``graphite-api.yaml`` in the directory where ``docker build`` is called or edit the file on the container and kill gunicorn processes to make them restart.
56
+
The image will use a supplied ``graphite-api.yaml`` on build, when ``docker build`` is called on an InfluxGraph image.
57
57
58
58
Main features
59
59
==============
60
60
61
-
* InfluxDB Graphite template support - allows for exposure of InfluxDB tagged data as Graphite metrics
62
-
* Dynamically calculated group by intervals based on query date/time range
61
+
* InfluxDB Graphite template support - expose InfluxDB tagged data as Graphite metrics with configurable metric paths
62
+
* Dynamically calculated group by intervals based on query date/time range - fast queries regardless of the date/time they span
63
63
* Configurable per-query aggregation functions by regular expression pattern
64
-
* Configurable per-query retention policies by query date/time range. Use pre-calculated downsampled data in a retention policy for historical data automatically
65
-
* In-memory index for metric path queries
64
+
* Configurable per-query retention policies by query date/time range. Automatically use pre-calculated downsampled data in a retention policy for historical data
65
+
* In-memory index for Graphite metric path queries
66
66
* Multi-fetch enabled - fetch data for multiple metrics with one query to InfluxDB
67
67
* Multi-query support - runs multiple queries in one statement to InfluxDB for metrics in more than one series
68
68
* Memcached integration
69
69
* Python 3 and PyPy compatibility
70
+
* Good performance even with very large number of measurements in the DB - generated queries are guaranteed to be have O(1) performance characteristics
70
71
71
72
Goals
72
73
======
73
74
74
75
* Backwards compatibility with existing Graphite API clients like Grafana and Graphite installations migrated to InfluxDB backends using Graphite input service *with or without* Graphite template configuration
75
-
* Forwards compatibility with native InfluxDB API input data exposed via Graphite API
76
+
* Forwards compatibility with native InfluxDB API input data to be exposed via Graphite API
76
77
* Clean, readable code with complete documentation for public endpoints
77
78
* Complete code coverage with both unit and integration testing. Code has `>90%` test coverage and is integration tested against a real InfluxDB service
78
79
79
80
The two top points provide both
80
81
81
82
- A backwards compatible migration path for existing Graphite installations to use InfluxDB as a drop-in storage back-end replacement with no API client side changes required, meaning existing Grafana or other dashboards continue to work as-is.
82
-
- A forwards compatible migration path for native InfluxDB collection agents to expose their data via the *Graphite API* which allows the use of any Graphite API talking tool, the plethora of Graphite API functions, custom functions, multi-series plotting and function support et al.
83
+
- A way for native InfluxDB collection agents to expose their data via the *Graphite API* which allows the use of any Graphite API talking tool, the plethora of Graphite API functions, custom functions, multi-series plotting and function support et al.
83
84
84
85
As of this time of writing, no alternatives exist with similar functionality and compatibility.
Even data written to InfluxDB by native InfluxDB API clients can be exposed as Graphite metrics, allowing transparent to clients use of the Graphite API with InfluxDB acting as its storage back-end.
102
103
103
-
To make use of tagged InfluxDB data, the plugin needs to know how to parse a Graphite metric path into the tags used by InfluxDB.
104
+
To make use of tagged InfluxDB data, the finder needs to know how to generate a Graphite metric path from the tags used by InfluxDB.
104
105
105
-
The easiest way to do this is to use the Graphite plugin in InfluxDB with a configured template which can be used as-is in `InfluxGraph`_ configuration, see `Full Configuration Example`_ section for details. This presumes existing metrics collection agents are using the Graphite line protocol to write to InfluxDB via its Graphite input service.
106
+
The easiest way to do this is to use the Graphite plugin in InfluxDB with a configured template which can be used as-is in `InfluxGraph`_ configuration - see `Full Configuration Example`_ section for details. This presumes existing collection agents are using the Graphite line protocol to write to InfluxDB via its Graphite input service.
106
107
107
108
If, on the other hand, native `InfluxDB`_ metrics collection agents like `Telegraf <https://www.influxdata.com/time-series-platform/telegraf/>`_ are used, that data can too be exposed as Graphite metrics by writing appropriate template(s) in Graphite-API configuration alone.
108
109
@@ -327,9 +328,9 @@ Full Configuration Example
327
328
Aggregation function configuration
328
329
-----------------------------------
329
330
330
-
The graphite-influxdb finder now supports configurable aggregation functions to use for specific metric path patterns. This is the equivalent of ``storage-aggregation.conf`` in Graphite's ``carbon-cache``.
331
+
The graphite-influxdb finder supports configurable aggregation functions to use for specific metric path patterns. This is the equivalent of ``storage-aggregation.conf`` in Graphite's ``carbon-cache``.
331
332
332
-
Default aggregation function used is ``mean``, meaning ``average``.
333
+
Default aggregation function used is ``mean``.
333
334
334
335
Graphite-influxdb has pre-defined aggregation configuration matching ``carbon-cache`` defaults, namely ::
335
336
@@ -347,22 +348,24 @@ Known InfluxDB aggregation functions are defined at ``influxgraph.constants.INFL
347
348
348
349
.. note::
349
350
350
-
Please note that when querying multiple series InfluxDB allows only *one* aggregation function to be used for all series in the query.
351
+
Please note that when querying identical fields from multiple measurements InfluxDB allows only *one* aggregation function to be used for all identical fields in the query.
351
352
352
-
In other words, client needs to make sure all series in a wildcard query, for example ``my_host.cpu.cpu*`` have the same aggregation function configured.
353
+
In other words, make sure all identical InfluxDB fields matched by a Graphite query pattern, for example ``my_host.cpu.*`` have the same aggregation function configured.
354
+
355
+
When using neither tagged data nor template configuration, the InfluxDB field to be queried is always ``value``. This is the case where this limitation is most relevant.
353
356
354
357
``InfluxGraph`` will use the first aggregation function configured and log a warning message to that effect if a wildcard query resolves to multiple aggregation functions.
355
358
356
-
Memcache caching InfluxDB data
357
-
------------------------------
359
+
Memcached InfluxDB
360
+
------------------------
358
361
359
-
Memcache can be used to cache InfluxDB data so the `Graphite-API` webapp can avoid querying the DB if it does not have to.
362
+
Memcached can be used to cache InfluxDB data so the `Graphite-API` webapp can avoid querying the DB if it does not have to.
360
363
361
364
TTL configuration for memcache shown above is only for `/metrics/find` endpoint with `/render` endpoint TTL being set to the data interval used.
362
365
363
366
For example, for a query spanning 24hrs, a data interval of 1 min is used by default. TTL for memcache is set to 1 min for that data.
364
367
365
-
For a query spanning 1 month, a 15min interval is used. TTL is also set to 15min for that data.
368
+
For a query spanning 1 month, a 15min interval is used by default. TTL is also set to 15min for that data.
366
369
367
370
368
371
Calculated intervals
@@ -414,10 +417,12 @@ A different HTTP caching service will similarly work just as well.
414
417
Known Limitations
415
418
==================
416
419
417
-
- In memory index can use *a lot* of memory in InfluxDB installations with a large number of unique metrics (> 1M). `Pypy <http://pypy.org>`_ is recommended in that case which allows for a much lower memory footprint compared to the CPython intepreter.
420
+
- Index memory usage will be a factor of about 10 higher than the size of the uncompressed on disk index. For example a 100MB uncompressed on-disk index will use ~1GB of memory. This is already as low as it can be, is a hard limit imposed by Python interpreter implementation details and not likely to get any better without changes to use memory mapped file rather than loading the whole index in memory, which is AFAIK only supported on Py3 and in the index's C extension.
421
+
- On CPython interpreters, API requests while an index re-build is happening will be quite slow (a few seconds, no more than ten). PyPy does not have this problem and is recommended.
418
422
419
-
The docker container in this document uses PyPy.
423
+
The docker image provided uses PyPy.
420
424
425
+
Contributions are most welcome to resolve any of these limitations and for anything else.
0 commit comments