Skip to content

Conversation

@DifferentialOrange
Copy link
Member

@DifferentialOrange DifferentialOrange commented Jul 29, 2022

Merge after #173

In Grafana 7.2 $__rate_interval for Prometheus rate() requests was introduced. This patch replaces user-specified $rate_time_range variable with in-built $__rate_interval.

Since $__rate_interval should be enough to cover all rate cases, this patch also removes all code traces of rate time range configuration.

Closes #127

Before this patch, datasource request target choice was based on
a datasource value. Only two possible values were supported for
a datasource: ${DS_INFLUXDB} for a templating InfluxDB  datasource and
${DS_PROMETHEUS} for a templating Prometheus datasource. After this
patch, datasource type to choose a target is set with a separate
variable, so now it's possible to pass a non-templating datasource
value.

Part of #90
Remove Prometheus-related warning from "Tuples checked" panel
description in case of InfluxDB dashboard.
This patch add several make targets to build a static dashboard.

```bash
make DATASOURCE=MyPrometheus JOB=MyApp \
     OUTPUT_STATIC_DASHBOARD=mydashboard.json build-static-prometheus
```

Following targets are available:
- `build-static-prometheus`: Tarantool dashboard for
  a Prometheus datasource;
- `build-static-tdg-prometheus`: TDG dashboard for
  a Prometheus datasource;
- `build-static-influxdb`: Tarantool dashboard for
  an InfluxDB datasource;
- `build-static-tdg-influxdb`: TDG dashboard for an InfluxDB datasource.

Variables for Prometheus targets:
- `DATASOURCE`: name of a Prometheus data source;
- `JOB`: name of a Prometheus job collecting your application metrics;
- `RATE_TIME_RANGE` (optional, default `2m`): rps computation rate time
  range;
- `OUTPUT_STATIC_DASHBOARD` (optional, default `dashboard.json`):
  compiled dashboard file.

Variables for InfluxDB targets:
- `DATASOURCE`: name of a InfluxDB data source;
- `POLICY` (optional, default `autogen`): InfluxDB metrics retention
  policy;
- `MEASUREMENT`: name of a InfluxDB measurement with your application
  metrics;
- `OUTPUT_STATIC_DASHBOARD` (optional, default `dashboard.json`):
  compiled dashboard file.

This patch also adds tests to run these targets.

Closes #90
@DifferentialOrange DifferentialOrange force-pushed the DifferentialOrange/gh-127-default-time-range branch 2 times, most recently from 83ab313 to e0b95b4 Compare July 29, 2022 15:38
@DifferentialOrange
Copy link
Member Author

This variable is also do not forbid to create alerts on panels.

Set default Prometheus job to "tarantool". After this patch, it will be
possible to import dashboard with community.ansible.ansible_dashboard,
if Prometheus is configured to collect Tarantool metrics with
"tarantool" job.

This patch also changes all examples job names to "tarantool".

Part of #138
Set default InfluxDB measurement to "tarantool_http". After this patch,
it will be possible to import dashboard with
community.ansible.ansible_dashboard, if Telegraf is configured to
collect Tarantool metrics with http plugin and "tarantool_" prefix.

This patch also changes all examples measurement names
to "tarantool_http".

Closes #138
@DifferentialOrange DifferentialOrange force-pushed the DifferentialOrange/138-default-job branch from 1bd2096 to 85cb717 Compare July 29, 2022 15:57
@DifferentialOrange DifferentialOrange force-pushed the DifferentialOrange/gh-127-default-time-range branch from e0b95b4 to a4a61d4 Compare July 29, 2022 15:59
In Grafana 7.2 `$__rate_interval` for Prometheus rate() metrics was
introduced [1]. This patch replaces user-specified `$rate_time_range`
variable with in-built `$__rate_interval`.

Since `$__rate_interval` should be enough to cover all rate cases, this
patch also removes all code traces of rate time range configuration.

1. https://grafana.com/blog/2020/09/28/new-in-grafana-7.2-__rate_interval-for-prometheus-rate-queries-that-just-work/

Closes #127
@DifferentialOrange DifferentialOrange force-pushed the DifferentialOrange/gh-127-default-time-range branch from a4a61d4 to 7890893 Compare August 1, 2022 11:40
@DifferentialOrange DifferentialOrange force-pushed the DifferentialOrange/138-default-job branch 2 times, most recently from 8094b7a to 001bbf9 Compare August 3, 2022 10:38
@DifferentialOrange DifferentialOrange deleted the branch DifferentialOrange/138-default-job August 3, 2022 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants