|
| 1 | +.. _monitoring-grafana_dashboard-page: |
| 2 | + |
| 3 | +=============================================================================== |
| 4 | +Grafana dashboard |
| 5 | +=============================================================================== |
| 6 | + |
| 7 | +Tarantool Grafana dashboard is available as part of |
| 8 | +`Grafana Official & community built dashboards <https://grafana.com/grafana/dashboards>`_. |
| 9 | +You can find version for Prometheus datasource on |
| 10 | +`this page <https://grafana.com/grafana/dashboards/13054>`_ and version for |
| 11 | +InfluxDB datasource on `this page <https://grafana.com/grafana/dashboards/12567>`_. |
| 12 | +Tarantool Grafana dashboard is a ready for import template with basic memory, |
| 13 | +space operations and HTTP load panels, based on default `metrics <https://github.com/tarantool/metrics>`_ |
| 14 | +package functionality. |
| 15 | + |
| 16 | +Dashboard requires using ``metrics`` **0.5.0** or newer; |
| 17 | +``'alias'`` :ref:`global label <tarantool-metrics>` must be set on each instance |
| 18 | +to properly display panels (e.g. provided with ``cartridge.roles.metrics`` role). |
| 19 | + |
| 20 | +.. image:: images/Prometheus_dashboard_1.png |
| 21 | + :width: 30% |
| 22 | + |
| 23 | +.. image:: images/Prometheus_dashboard_2.png |
| 24 | + :width: 30% |
| 25 | + |
| 26 | +.. image:: images/Prometheus_dashboard_3.png |
| 27 | + :width: 30% |
| 28 | + |
| 29 | +.. _monitoring-grafana_dashboard-monitoring_stack: |
| 30 | + |
| 31 | +------------------------------------------------------------------------------- |
| 32 | +Prepare a monitoring stack |
| 33 | +------------------------------------------------------------------------------- |
| 34 | + |
| 35 | +Since there are Prometheus and InfluxDB datasource Grafana dashboards, |
| 36 | +you can use |
| 37 | + |
| 38 | +- `Telegraf <https://www.influxdata.com/time-series-platform/telegraf/>`_ |
| 39 | + as a server agent for collecting metrics, `InfluxDB <https://www.influxdata.com/>`_ |
| 40 | + as a time series database for storing metrics, `Grafana <https://grafana.com/>`_ |
| 41 | + as a visualization platform; or |
| 42 | +- `Prometheus <https://prometheus.io/>`_ as both server agent for collecting metrics |
| 43 | + and time series database for storing metrics, `Grafana <https://grafana.com/>`_ |
| 44 | + as a visualization platform. |
| 45 | + |
| 46 | +For issues concerning set up of Prometheus, Telegraf, InfluxDB or Grafana instances |
| 47 | +please refer to corresponding project's documentation. |
| 48 | + |
| 49 | +.. _monitoring-grafana_dashboard-collect_metrics: |
| 50 | + |
| 51 | +------------------------------------------------------------------------------- |
| 52 | +Collect metrics with server agents |
| 53 | +------------------------------------------------------------------------------- |
| 54 | + |
| 55 | +To collect metrics for Prometheus, first off you must set up metrics output with |
| 56 | +``prometheus`` format. You can use :ref:`cartridge.roles.metrics <cartridge-role>` |
| 57 | +configuration or set up :ref:`output plugin <prometheus>` manually. |
| 58 | +To start collecting metrics, add a `job <https://prometheus.io/docs/prometheus/latest/getting_started/#configure-prometheus-to-monitor-the-sample-targets>`_ |
| 59 | +to Prometheus configuration with each Tarantool instance URI as a target and |
| 60 | +metrics path as it was configured on Tarantool instances: |
| 61 | + |
| 62 | +.. code-block:: yaml |
| 63 | +
|
| 64 | + scrape_configs: |
| 65 | + - job_name: "example_project" |
| 66 | + static_configs: |
| 67 | + - targets: |
| 68 | + - "example_project:8081" |
| 69 | + - "example_project:8082" |
| 70 | + - "example_project:8083" |
| 71 | + metrics_path: "/metrics/prometheus" |
| 72 | +
|
| 73 | +
|
| 74 | +To collect metrics for InfluxDB, you must use Telegraf agent. |
| 75 | +First off, configure Tarantool metrics output in ``json`` format |
| 76 | +with :ref:`cartridge.roles.metrics <cartridge-role>` configuration or |
| 77 | +corresponding :ref:`output plugin <json>`. To start collecting metrics, |
| 78 | +add `http input <https://github.com/influxdata/telegraf/blob/release-1.17/plugins/inputs/http/README.md>`_ |
| 79 | +to Telegraf configuration including each Tarantool instance metrics URL: |
| 80 | + |
| 81 | +.. code-block:: text |
| 82 | +
|
| 83 | + [[inputs.http]] |
| 84 | + urls = [ |
| 85 | + "http://example_project:8081/metrics/json", |
| 86 | + "http://example_project:8082/metrics/json", |
| 87 | + "http://example_project:8083/metrics/json" |
| 88 | + ] |
| 89 | + timeout = "30s" |
| 90 | + tag_keys = [ |
| 91 | + "metric_name", |
| 92 | + "label_pairs_alias", |
| 93 | + "label_pairs_quantile", |
| 94 | + "label_pairs_path", |
| 95 | + "label_pairs_method", |
| 96 | + "label_pairs_status", |
| 97 | + "label_pairs_operation" |
| 98 | + ] |
| 99 | + insecure_skip_verify = true |
| 100 | + interval = "10s" |
| 101 | + data_format = "json" |
| 102 | + name_prefix = "example_project_" |
| 103 | + fieldpass = ["value"] |
| 104 | +
|
| 105 | +Be sure to include each label key as ``label_pairs_<key>`` so it will be |
| 106 | +extracted with plugin. For example, if you use :code:`{ state = 'ready' }` labels |
| 107 | +somewhere in metric collectors, add ``label_pairs_state`` tag key. |
| 108 | + |
| 109 | +If you connect Telegraf instance to InfluxDB storage, metrics will be stored |
| 110 | +with ``"<name_prefix>http"`` measurement (``"example_project_http"`` in our example). |
| 111 | + |
| 112 | +.. _monitoring-grafana_dashboard-import: |
| 113 | + |
| 114 | +------------------------------------------------------------------------------- |
| 115 | +Import the dashboard |
| 116 | +------------------------------------------------------------------------------- |
| 117 | +Open Grafana import menu. |
| 118 | + |
| 119 | +.. image:: images/grafana_import_v6.png |
| 120 | + :align: left |
| 121 | + |
| 122 | +To import specific dashboard, choose one of the following options: |
| 123 | + |
| 124 | +- paste dashboard id (``12567`` for InfluxDB dashboard, ``13054`` for Prometheus dashboard), or |
| 125 | +- paste link to dashboard (https://grafana.com/grafana/dashboards/12567 for InfluxDB dashboard, |
| 126 | + https://grafana.com/grafana/dashboards/13054 for Prometheus dashboard), or |
| 127 | +- paste dashboard json file contents, or |
| 128 | +- upload dashboard json file. |
| 129 | + |
| 130 | +Set dashboard name, folder, uid (if needed), and datasource-related query parameters |
| 131 | +(InfluxDB source, measurement and policy or Prometheus source, job and rate time range). |
| 132 | + |
| 133 | +.. image:: images/grafana_import_setup_v6.png |
| 134 | + :align: left |
| 135 | + |
| 136 | +.. _monitoring-grafana_dashboard-troubleshooting: |
| 137 | + |
| 138 | +------------------------------------------------------------------------------- |
| 139 | +Troubleshooting |
| 140 | +------------------------------------------------------------------------------- |
| 141 | + |
| 142 | +If no data presents on graphs, ensure that you set up datasource and job/measurement correctly. |
| 143 | + |
| 144 | +If no data presents on rps graphs on Prometheus table, ensure that |
| 145 | +your rate time range parameter is at least twice as Prometheus scrape interval. |
0 commit comments