diff --git a/doc/monitoring/getting_started.rst b/doc/monitoring/getting_started.rst index f55c3206..b43e63c7 100644 --- a/doc/monitoring/getting_started.rst +++ b/doc/monitoring/getting_started.rst @@ -194,3 +194,120 @@ via configuration. format: 'json' .. _grafana-dashboard: + +------------------------------------------------------------------------------- +Grafana dashboard +------------------------------------------------------------------------------- + +Tarantool Grafana dashboard is available as part of +`Grafana Official & community built dashboards `_. +You can find version for Prometheus datasource on +`this page `_ and version for +InfluxDB datasource on `this page `_. +Tarantool Grafana dashboard is a ready for import template with basic memory, space operations +and HTTP load panels, based on default ``metrics`` package functionality. + +Dashboards require using ``metrics`` **0.5.0** or newer; +``'alias'`` :ref:`global label ` must be set on each instance +to properly display panels (e.g. provided with ``cartridge.roles.metrics`` role). + +**Usage** + +#. Set up your monitoring stack. Since there are `Prometheus `_ + and `InfluxDB `_ datasource Grafana dashboards, + you can use + + - `Telegraf `_ + as a server agent for collecting metrics, `InfluxDB `_ + as a time series database for storing metrics, `Grafana `_ + as a visualization platform; or + - `Prometheus `_ as both server agent for collecting metrics + and time series database for storing metrics, `Grafana `_ + as a visualization platform. + + For issues concerning set up of Prometheus, Telegraf, InfluxDB or Grafana instances + please refer to corresponding project's documentation. + +#. Configure your Tarantool instances to output metrics with proper format + and configure corresponding server agent to collect them. + + To collect metrics for Prometheus, first off you must set up metrics output with + ``prometheus`` format. You can use :ref:`cartridge.roles.metrics ` + configuration or set up :ref:`output plugin ` manually. + To start collecting metrics, add a `job `_ + to Prometheus configuration with each Tarantool instance URI as a target and + metrics path as it was configured on Tarantool instances: + + .. code-block:: yaml + + scrape_configs: + - job_name: "example_project" + static_configs: + - targets: + - "example_project:8081" + - "example_project:8082" + - "example_project:8083" + metrics_path: "/metrics/prometheus" + + To collect metrics for InfluxDB, you must use Telegraf agent. + First off, configure Tarantool metrics output in ``json`` format + with :ref:`cartridge.roles.metrics ` configuration or + corresponding :ref:`output plugin `. To start collecting metrics, + add `http input `_ + to Telegraf configuration including each Tarantool instance metrics URL: + + .. code-block:: text + + [[inputs.http]] + urls = [ + "http://example_project:8081/metrics/json", + "http://example_project:8082/metrics/json", + "http://example_project:8083/metrics/json" + ] + timeout = "30s" + tag_keys = [ + "metric_name", + "label_pairs_alias", + "label_pairs_quantile", + "label_pairs_path", + "label_pairs_method", + "label_pairs_status", + "label_pairs_operation" + ] + insecure_skip_verify = true + interval = "10s" + data_format = "json" + name_prefix = "example_project_" + fieldpass = ["value"] + + Be sure to include each label key as ``label_pairs_`` so it will be + extracted with plugin. For example, if you use :code:`{ state = 'ready' }` labels + somewhere in metric collectors, add ``label_pairs_state`` tag key. + + If you connect Telegraf instance to InfluxDB storage, metrics will be stored + with ``"http"`` measurement (``"example_project_http"`` in our example). + +#. Import a dashboard from `Grafana Official & community built dashboards `_. + + Open Grafana import menu. + + .. image:: images/grafana-import-v6.png + :align: center + + To import specific dashboard, choose one of the following options: + + - paste dashboard id (``12567`` for InfluxDB dashboard, ``13054`` for Prometheus dashboard), or + - paste link to dashboard (https://grafana.com/grafana/dashboards/12567 for InfluxDB dashboard, + https://grafana.com/grafana/dashboards/13054 for Prometheus dashboard), or + - paste dashboard json file contents, or + - upload dashboard json file. + + Set dashboard name, folder, uid (if needed), and datasource-related query parameters + (InfluxDB source, measurement and policy or Prometheus source, job and rate time range). + + .. image:: images/grafana-import-setup-v6.png + :align: center + + If no data present on graphs, ensure that you set up datasource and job/measurement correctly. + If no data present on rps graphs on Prometheus table, ensure that + your rate time range parameter is at least twice as Prometheus scrape interval. diff --git a/doc/monitoring/images/grafana-import-setup-v6.png b/doc/monitoring/images/grafana-import-setup-v6.png new file mode 100644 index 00000000..70b38b70 Binary files /dev/null and b/doc/monitoring/images/grafana-import-setup-v6.png differ diff --git a/doc/monitoring/images/grafana-import-v6.png b/doc/monitoring/images/grafana-import-v6.png new file mode 100644 index 00000000..6c860f4d Binary files /dev/null and b/doc/monitoring/images/grafana-import-v6.png differ