> For the complete documentation index, see [llms.txt](https://docs.percona.com/percona-monitoring-and-management/3/llms.txt).

# VictoriaMetrics

[VictoriaMetrics](https://victoriametrics.github.io/) is a third-party monitoring solution and time-series database.

## Push/Pull modes

VictoriaMetrics metrics data can be both ‘pushed’ to the server and ‘pulled’ by the server. When setting up services, you can decide which mode to use.

The mode (push/pull) is controlled by the `--metrics-mode` flag for the `pmm-admin config` and `pmm-admin add` commands.

To change the metrics mode of an existing exporter, run `pmm-admin inventory change agent <AGENT_TYPE> <AGENT_ID> --push-metrics` for push mode, or `--push-metrics=false` for pull mode. See [`pmm-admin inventory change agent`](https://docs.percona.com/percona-monitoring-and-management/3/use/commands/pmm-admin/inventory.md#pmm-admin-inventory-change-agent).

## Remapped targets for direct Prometheus paths

Direct Prometheus paths return structured information directly from Prometheus, bypassing the PMM application.

They are accessed by requesting a URL of the form `<PMM SERVER URL>/prometheus/<PATH>`.

As a result of the move to VictoriaMetrics some direct Prometheus paths are no longer available.

| Prometheus path                 | VictoriaMetrics equivalent                                                                                           |
| ------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| `/prometheus/alerts`            | No change.                                                                                                           |
| `/prometheus/config`            | No equivalent, but there is some information at `/prometheus/targets`.                                               |
| `/prometheus/flags`             | The `flag` metrics at `/prometheus/metrics`.                                                                         |
| `/prometheus/graph`             | `/graph/explore` (Grafana) or `graph/d/prometheus-advanced/advanced-data-exploration` (PMM dashboard).               |
| `/prometheus/rules`             | No change.                                                                                                           |
| `/prometheus/service-discovery` | No equivalent.                                                                                                       |
| `/prometheus/status`            | Some information at `/prometheus/metrics`. High cardinality metrics information at `/prometheus/api/v1/status/tsdb`. |
| `/prometheus/targets`           | `/victoriametrics/targets`                                                                                           |

## Environment variables

PMM predefines certain flags that allow users to set all other [VictoriaMetrics parameters](https://docs.victoriametrics.com/#list-of-command-line-flags) as environment variables:

The environment variable must be prepended with `VM_`.

### Example

To set downsampling, use the `downsampling.period` parameter as follows:

```text
-e VM_downsampling_period=20d:10m,120d:2h
```

This instructs VictoriaMetrics to [deduplicate](https://docs.victoriametrics.com/#deduplication) samples older than 20 days with 10 minute intervals and samples older than 120 days with two hour intervals.

### Prepare for the end of downsampling

PMM 3.11.0 deprecates downsampling, which you configure with `VM_downsampling_period`. It keeps working in PMM 3.11.0, but PMM 3.12.0 will remove it, because PMM 3.12.0 will switch to the official open source release of VictoriaMetrics, which doesn’t include downsampling.

Once PMM 3.12.0 is out and you upgrade to it, PMM ignores the variable and logs a warning at startup. New metrics stay at full resolution, so they need more disk space, and data that is already downsampled stays downsampled.

Downsampling saves disk space by keeping fewer samples of older data. To keep disk use under control without it, choose one of these options before you upgrade to PMM 3.12.0:

- set `VM_dedup_minScrapeInterval` to deduplicate all data, not only old data.
- collect metrics less often with the [metrics resolution](https://docs.percona.com/percona-monitoring-and-management/3/configure-pmm/metrics_res.md) settings.
- shorten the retention period or add disk space.
- send metrics to an [external VictoriaMetrics Enterprise database](#using-victoriametrics-external-database-instance), which is a Technical Preview feature.

## Using VictoriaMetrics external database instance

Important/Caution

This feature is still in [Technical Preview](https://docs.percona.com/percona-monitoring-and-management/3/reference/glossary.md#technical-preview) and is subject to change. We recommend that early adopters use this feature for evaluation purposes only.

You can use an external VictoriaMetrics database for monitoring in PMM.

The environment variable `PMM_VM_URL` has been added, which should point to the external VictoriaMetrics database and should have the following format:

```sh
http(s)://hostname:port/path.
```

If the external VictoriaMetrics database requires basic authentication, the following environment variables should be used.

```sh
VMAGENT_remoteWrite_basicAuth_username={username}
VMAGENT_remoteWrite_basicAuth_password={password}
```

These credentials can be [set on PMM Server](https://docs.percona.com/percona-monitoring-and-management/3/install-pmm/install-pmm-server/deployment-options/docker/env_var.md#configure-vmagent-variables) and will automatically apply to all connected PMM Clients.

If other authentication methods are used on the VictoriaMetrics side, use any of the `vmagent` environment variables by prepending `VMAGENT_ prefix`.

When external VictoriaMetrics is configured, internal VictoriaMetrics stops. In this case, VM Agent on PMM Server pulls metrics from agents configured in the `pull metrics mode` and from remote nodes. Data is then pushed to external VictoriaMetrics.

Note

VM Agents run by PMM Clients push data directly to external VictoriaMetrics.

Ensure that they can connect to external VictoriaMetrics.

## Troubleshooting

To troubleshoot issues, see the VictoriaMetrics [troubleshooting documentation](https://victoriametrics.github.io/#troubleshooting).

You can also contact the VictoriaMetrics team via:

- [Google Groups](https://groups.google.com/forum/#!forum/victorametrics-users)
- [Slack](http://slack.victoriametrics.com/)
- [Reddit](https://www.reddit.com/r/VictoriaMetrics/)
- [Telegram](https://t.me/VictoriaMetrics_en)
