-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
26 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,39 @@ | ||
.. _cassandra: | ||
.. _prometheus: | ||
|
||
Cassandra | ||
========= | ||
Prometheus | ||
========== | ||
|
||
You can export statistics to a ``Cassandra`` or ``Scylla`` server. | ||
The connection should be defined in the Glances configuration file as | ||
following: | ||
You can export statistics to a ``Prometheus`` server through an exporter. | ||
When the *--export-prometheus* is used, Glances creates a Prometheus exporter | ||
listening on <host:port> (define in the Glances configuration file). | ||
|
||
.. code-block:: ini | ||
[cassandra] | ||
[prometheus] | ||
host=localhost | ||
port=9042 | ||
protocol_version=3 | ||
keyspace=glances | ||
replication_factor=2 | ||
table=localhost | ||
port=9091 | ||
prefix=glances | ||
and run Glances with: | ||
|
||
.. code-block:: console | ||
$ glances --export-cassandra | ||
$ glances --export-prometheus | ||
The data model is the following: | ||
You can check that Glances exports the stats using this URL: http://localhost:9091 | ||
|
||
.. image:: ../_static/prometheus_exporter.png | ||
|
||
In order to store the metrics in a Prometheus server, you should add this | ||
exporter to your Prometheus server configuration with the following lines | ||
(in the prometheus.yml configuration file): | ||
|
||
.. code-block:: ini | ||
CREATE TABLE <table> (plugin text, time timeuuid, stat map<text,float>, PRIMARY KEY (plugin, time)) | ||
scrape_configs: | ||
- job_name: 'glances_exporter' | ||
scrape_interval: 5s | ||
static_configs: | ||
- targets: ['localhost:9091'] | ||
Only numerical stats are stored in the Cassandra table. All the stats | ||
are converted to float. If a stat cannot be converted to float, it is | ||
not stored in the database. | ||
.. image:: ../_static/prometheus_server.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters