How to Configure a Remote Data Store for Prometheus
Introduction
The Prometheus monitoring tool can store its metrics either locally or remotely. You can configure a remote data store using the remote_write
configuration.
This article describes the various data store options available as well as how to set up a remote store.
Overview of Remote Storage
By default, Prometheus stores data locally wherever it is installed. The data directory can be configured by using the --storage.tsdb.path
command line option when starting Prometheus.
In practice you can use a separate disk for higher performance attached to the machine where Prometheus is running.
However, this may not be possible or optimal in all situations as you might want a data store that is more suited for time series data, and has larger storage capabilities for higher data retention. Prometheus would usually run in a standalone VM or a Kubernetes pod or a Docker container, and it would not have access to such data stores by default.
A remote store can add these capabilities to Prometheus. The remote storage option can be set by using the remote_write
key in the Prometheus configuration YAML file.