Query a Metric and Raise an Alert Event
A 3-step recipe with Dynatrace. We can help you get access.
Recipe · 3 steps
Query a Metric and Raise an Alert Event
with Dynatrace · Observability Management
Read a metric, query its data, and raise a custom alert event.
- Read the metric descriptor to confirm the metric exists and to learn its unit and supported aggregation types before querying data.
- Query data points for the metric selector over the time range, scoped to the supplied entity selector and resolution.
- Ingest a CUSTOM_ALERT event onto the affected entities' timeline, attaching the metric key and reading as properties.
What you'll need to have ready
- metricKey: The metric key to inspect (e.g. builtin:host.cpu.usage).
- metricSelector: The metric selector with transformations (e.g. builtin:host.cpu.usage:avg).
- entitySelector: The entity selector scoping the query (e.g. type(HOST),tag(prod)).
- resolution: The desired data-point resolution (e.g. 5m, 1h).
- from: Start of the queried time range (e.g. now-2h).
- alertTitle: The title of the custom alert event to raise.
For your developer
Arazzo workflow dynatrace:metric-threshold-alert, 3 operations: getMetricDescriptor → queryMetricData → ingestEvent. Specs on APIs.io.