Metrics
Ingest time-series metric data into Harness IDP, correlate it with catalog entities, and display it as charts on entity pages.
Metrics let you push time-series data into Harness IDP and display it as charts on catalog entity pages. Use them for anything you would plot over time, for example, latency percentiles, error rates, deployment frequency, uptime, or any numeric value that changes continuously.
Metrics are configured and managed separately from Custom Integrations, but they share the same feature flag (IDP_CUSTOM_INTEGRATION), sit on the same Integrations page, and use the same correlation model.

Before you begin
The
IDP_CUSTOM_INTEGRATIONfeature flag must be enabled on your account. Contact Harness Support to enable it.You need a Harness Service Account Token (SAT) or Personal Access Token (PAT).
Create a Metric
In Harness IDP, go to Configure → Integrations.
Select Metrics at the top right of the page.

Select + New Metric.
Step 1: Configure the metric
The Metric Configuration form has three sections:

Metric Name
Yes
A human-readable name, for example Deployment Frequency or API Latency P99.
Id
Yes
Auto-generated from the name. Select the pencil icon to change it. The Id becomes part of the ingestion endpoint URL and cannot be changed after creation.
Metrics Description
No
What the metric tracks, for example "Tracks how often code is deployed to production".
Step 2: Configure Correlation Mapping (optional)
Correlation Mapping links metric data points to catalog entities, using the same model as Custom Integrations.
Ingested Data Path
The field in the incoming payload to match on. The dropdown lists the available fields: entity_ref and any tag keys.
Operator
The comparison to apply. Equals is supported.
Catalog YAML Path
The path in the catalog entity YAML to match against, for example metadata.name.
If you leave Correlation Mapping empty, data points must carry an entity_ref in the payload to be linked to an entity.
Step 3: Confirm
Select Confirm. The metric is created and its detail page opens.
Ingest metric data
On the metric's Overview tab, copy the Upsert Endpoint:

The endpoint has this shape:
Headers
x-api-key
Yes
Both service account tokens (SAT) and personal access tokens (PAT) are supported. Refer Add and manage api keys.
Harness-Account
Yes
Your Harness account ID.
Content-Type
Yes
application/json
Request body
metrics
array of objects
Yes
At least one data point. Each point has a value (number) and a timestamp (ISO 8601 string).
entity_ref
string
No
Links these data points to a catalog entity directly. Can be null for metrics not tied to a specific entity.
tags
object
No
Key-value pairs of string tags to categorize or filter the metric. Usable as the source side of a Correlation Mapping.
cURL example
Monitor ingestion with the Events tab
Every Metric has an Events tab that records creation and ingestion activity, identical in structure to the Events tab on Custom Integrations.

Metric created
The metric was created successfully.
Metric entity ingested
Data points were ingested successfully. The description shows how many.
Metric entity rejected
An incoming payload was not ingested. The description gives the reason.
Display metrics on entity pages
To show metric data on a catalog entity page, add a tab to your entity layout using the CustomMetricsTab component:
Follow the same steps as for Custom Integration tabs: go to Configure → Layout → Catalog Entities, edit the layout for the relevant entity kind and type, add the tab entry, and select Save. See Configure the layout for the full walkthrough.
The tab displays a chart of the metric data points over time for that entity. Users can select a time range and hover over data points to see the value and timestamp.

Manage a Metric
To manage an existing metric, go to Configure → Integrations → Metrics, find its card, and select View. Then select Configuration at the top right.
You can update the Metric Name, Metrics Description, and the Catalog YAML Path of the Correlation Mapping.
The Id and the Ingested Data Path of the Correlation Mapping are fixed after creation.
FAQs
Last updated
Was this helpful?