Remote Read
Configuring remote read
This guide will walk you through configuring your Prometheus instance to read metrics from our Observe API at Cyso.
For security reasons, this API is protected with Basic Authentication. This documentation will guide you through the process of setting this up.
Prerequisites
- Prometheus is installed and running.
- You have administrative access to your Prometheus server.
- You have your Cyso customer ID and API key on hand.
Configuration Steps
Follow the steps below to configure remote_read
in your Prometheus instance:
-
Open your Prometheus configuration file. This is usually located at
/etc/prometheus/prometheus.yml
, but the location can differ depending on your installation. -
In the YAML configuration file, find the section labeled
remote_read
. If it doesn't exist, you can add it. -
Add the following configuration under
remote_read
:
Username, password and customer id
Replace the username and password in the following example with the credentials received by Cyso:
- Username: will be your customer ID
- Password: The API key received
- URL: Replace {customer_id} with your customer ID
remote_read:
- url: "https://api.ams2.observe.cyso.com/{customer_id}/metrics/prometheus/api/v1/read"
basic_auth:
username: "{customer_id}"
password: "{token}"
-
This configuration includes the
url
from which Prometheus will read the metrics. It also contains thebasic_auth
section, which includes your username and password. -
Save and close the file.
-
To activate the changes, restart the Prometheus service with the following command:
sudo systemctl restart prometheus
Verify Configuration
To confirm that the configuration is working properly:
- Check the Prometheus logs for any errors. The logs are typically located at
/var/log/prometheus/prometheus.log
, but the location can vary depending on your installation.
About remote read
Prometheus remote_read
is a feature within the Prometheus monitoring system that enables it to retrieve metrics data from a remote storage backend. This feature complements the remote_write
functionality, which is used to write and send metrics data to a remote storage system.
The remote_read
feature is particularly useful in scenarios where Prometheus is configured to store metrics data remotely for long-term retention or large-scale environments. While remote_write
sends data to a remote storage backend, remote_read
retrieves this data and makes it available for querying within Prometheus.
Prometheus uses its own query language, PromQL, for data analysis. By using the remote_read
feature, you can use PromQL to query metrics stored remotely, just as if the data were locally stored. This allows you to benefit from the long-term, scalable storage capabilities of a remote backend, while maintaining the strong query capabilities of Prometheus.
Troubleshooting
If you encounter issues during setup, please check the following:
- Verify that the Prometheus service is running.
- Check the Prometheus logs for any errors.
- Ensure that the provided credentials are correct. If they aren't, you won't be able to read metrics.
If you need any further help, don't hesitate to get in touch with us.