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.
Only predefined metric definitions can be derived from events. Custom metrics must still be updated manually.
Metric Name | Derived Event Types |
---|---|
MTTR | Incidents |
Deployment Frequency | Deployments |
Build Success Rate | Builds |
Deployment Time | Deployments |
Build Time | Builds |
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.
To update the value of a derived metric, you must push a new event to that component, either through the API or an integration. The derived metric will be recalculated within two hours from the event being received.
In addition, time-based derived metrics will be automatically recalculated by Compass periodically. 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: