For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs.
Skip to content

Add a Prometheus connector

Add a Prometheus connector so Harness can fetch metrics from your Prometheus server for verification.

Prometheus is an open-source monitoring system that collects metrics from applications and infrastructure and stores them as time-series data, which you query using PromQL. Add a Prometheus connector in Harness to let your pipelines query metrics from your Prometheus server. Harness can then use that data in Continuous Verification to compare metric behavior before and after a deployment, helping you confirm a release is healthy or trigger a rollback.

Go to Overview for information about all monitoring and logging connectors, such as scopes and delegate selection.


What you will learn from this topic


Before you begin

  • Prometheus server: The URL of a Prometheus server that Harness or your delegate can reach over a network.

  • Harness permissions: Permission to create connectors and secrets in Harness.


Add a Prometheus connector

You can add a Prometheus connector at the project, org, or account scope. This procedure covers the project scope, and the process is the same for org and account.

  1. Open your Harness project.

  2. In Project Settings, select Connectors.

  3. Click New Connector, then select Prometheus under Monitoring and Logging Systems. The Prometheus connector settings appear.

Overview

Configure the identity fields for the connector:

  1. In Name, enter a name for the connector. Harness generates the Id from the name.

  2. Optionally, add a Description and Tags.

  3. Click Continue.

Prometheus connector overview settings

Credentials

Configure the following settings:

  1. In URL, enter the URL of your Prometheus server. For example, https://prometheus.example.com:9090/.

  2. In Authentication(optional), enter the following details:

  3. In Headers, optionally enter the following details:

  4. Click Next.

Prometheus connector credentials with the URL, authentication, and headers fields

Delegates Setup

Select one of the following options:

  • Use any available Delegate: Harness selects an available delegate at runtime.

  • Only use Delegates with all of the following tags: Enter the tags of the delegates Harness must use with this connector.

The Test Delegate Connectivity list shows the delegates that match your selection. To add a delegate, click Install new Delegate.

Click Save and Continue.

Prometheus connector delegates setup with the delegate connectivity list

Verify Connection

Click Finish after the connection test succeeds. The connector is listed in Connectors page.


Sample YAML

The following example shows a YAML for the Prometheus connector created in this topic.

YAML - Prometheus connector

For the full connector YAML schema, including how to skip connector preflight checks, go to Create a connector using YAML.


Next steps

Last updated

Was this helpful?