Prometheus
Summary
Prometheus is a monitoring and analytics platform that allows customers to analyze, visualize, automate, and alert on metrics data. You can use Prometheus to drive insights into values such as:
- SLOs
Setup
In order to connect Cortex to your Prometheus instance, you’ll need to add the URL for your Prometheus server and basic authentication if it is configured under Settings → Prometheus. Each Prometheus instance can also optionally include a tenant id to monitor a specific tenant of a multiple tenant setup.
The Prometheus integration has multi-account support. You can add a configuration for each additional by repeating the process above.
Each configuration requires an alias, which Cortex uses to correlate the designated with registrations for various entities. Registrations can also use a default configuration without a listed alias. You can edit aliases and default configurations from the Prometheus page in your Cortex settings. Select the edit icon next to a given configuration and toggle Set as default on. If you only have one configuration, it will automatically be set as the default.
If you do not see the settings page you're looking for, you likely don't have the proper permissions and need to contact your admin.
Service Registration
Service Descriptor
You can create and manage SLOs by listing relevant SLIs through queries.
x-cortex-slos:
prometheus:
- errorQuery: sum(rate(http_server_requests_seconds_count{status=~"(5..|429)"}[5m]))
totalQuery: sum(rate(http_server_requests_seconds_count[5m]))
slo: 99.95
alias: my-prometheus-instance # alias is optional and only relevant if you have opted into multi account support
name: my-slo-name
Field | Description |
---|---|
errorQuery | Query that indicates error events for your metric. |
totalQuery | Query that indicates all events to be considered for your metric. |
slo | Target number for SLO. |
alias | Ties the SLO registration to a Prometheus instance listed under Settings → Prometheus. The alias parameter is optional, but if not provided the SLO will use the default configuration under Settings → Prometheus. |
name | The SLO's name in Prometheus. The name parameter is optional. |