Authentication

This provider requires authentication.

  • url: Prometheus server URL (required: True, sensitive: False)
  • username: Prometheus username (required: False, sensitive: False)
  • password: Prometheus password (required: False, sensitive: True)

Certain scopes may be required to perform specific actions or queries via the provider. Below is a summary of relevant scopes and their use cases:

  • connectivity: Connectivity Test (mandatory)

In workflows

This provider can be used in workflows.

As “step” to query data, example:

steps:
    - name: Query prometheus
      provider: prometheus
      config: "{{ provider.my_provider_name }}"
      with:
        query: {value}  

Check the following workflow examples:

Connecting via Webhook (omnidirectional)

This provider takes advantage of configurable webhooks available with Prometheus Alertmanager. Use the following template to configure AlertManager:

route:
  receiver: "keep"
  group_by: ['alertname']
  group_wait:      15s
  group_interval:  15s
  repeat_interval: 1m
  continue: true

receivers:
- name: "keep"
  webhook_configs:
  - url: 'KEEP_BACKEND_URL/alerts/event/prometheus'
    send_resolved: true
    http_config:
      basic_auth:
        username: api_key
        password: {api_key}

Connecting with the Provider

  1. Set up a Prometheus server and make sure it’s running.
  2. Get the prometheus_url where your Prometheus instance is accessible.
  3. (Optional) Obtain the API token from your Prometheus configuration if it’s protected.
  4. Provide these values in the provider configuration.

-Prometheus Querying API Documentation -Prometheus Official Documentation