summaryrefslogtreecommitdiff
path: root/doc/raketasks/generate_sample_prometheus_data.md
blob: 902be6862c810154663268ca7aa298837f334efb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Generate sample Prometheus data **(CORE ONLY)**

This command will run Prometheus queries for each of the metrics of a specific environment
for a series of time intervals to now:

- 30 minutes
- 3 hours
- 8 hours
- 24 hours
- 72 hours
- 7 days

The results of each of query are stored under a `sample_metrics` directory as a YAML
file named by the metric's `identifier`. When the environmental variable `USE_SAMPLE_METRICS`
is set, the Prometheus API query is re-routed to `Projects::Environments::SampleMetricsController`
which loads the appropriate data set if it is present within the `sample_metrics` directory.

This command requires an ID from an environment with an available Prometheus installation.

## Example

The following example demonstrates how to run the Rake task:

```shell
bundle exec rake gitlab:generate_sample_prometheus_data[21]
```