Last updated Apr 21, 2024

What are derived metrics?

Derived metrics make calculating metric values simple. Instead of pushing the metric values through the Compass API, or publishing them from a Forge app, derived metric values are automatically calculated based on the events received for your Compass component.

This removes the burden of complicated calculation code from your integration and standardizes calculations for common metrics across integrations.

For example, the Deployment Frequency metric is derived from deployment events. As you ingest deployment events on your component, you'll see the metric automatically recalculate.

Available derived metrics

Only built-in metric definitions can be derived from events. Custom metrics must still be updated manually.

Metric NameDerived Event Types
MTTRIncidents
Deployment FrequencyDeployments
Build Success RateBuilds
Deployment TimeDeployments
Build TimeBuilds

Create a derived metric source

When you connect one of the above metrics to a component via the UI, it's automatically derived based on events so you wouldn't need to manually create a new metric source using the API.

If you want to create a metric source using the GraphQL API instead, supply the derived: true option in your CreateMetricSource input. For example:

1
2
{
	"input": {
		"componentId": <your component ID>
		"metricDefinitionId": "ari:cloud:compass::metric-definition/builtin/weekly-deployment-frequency-28d",
		"externalMetricSourceId": "test123",
		"url": "https://bitbucket.org/my-workspace/my-project/src/main/",
		"derived": true
	}
}

You can't push values to derived metrics manually, they are only calculated based on events on that component.

Update a derived metric source

To update the value of a derived metric, you must push a new event to that component, either through the API or an integration.

In addition, derived metrics will be automatically recalculated by Compass once an hour. As an example, if you stop sending Deployment Events to a component, you should see your derived Deployment Frequency metric drop over time, without any additional input.

Rate this page: