Set alerts on metrics with custom threshold logic and temporal aggregation functions.
This feature is in beta, and we would love your feedback!
To opt in, join our Pollinators Community Slack and ping us in the #discuss-metrics
channel.
Pro and Enterprise users can also contact Honeycomb Support or email support@honeycomb.io.
This guide walks you through working with metrics-based Triggers during the Metrics 2.0 Beta. You will learn how to create and update metrics-based Triggers, see example configurations, and understand key limitations and differences from event-based Triggers.
Setting up a metrics-based Trigger works much like setting up an event-based Trigger, with a few key differences tailored to how metrics behave.
To create a metrics-based Trigger:
RATE()
or INCREASE()
, which compute change over time.
Example: my_rate_dc RATE(http_requests_total)
.SUM()
or AVG()
.
Example: SUM(my_rate_dc)
.Your Trigger will evaluate the query at regular intervals (every 15 minutes by default) and send alerts whenever the threshold condition is met.
You can modify a metrics-based Trigger the same way you edit an event-based Trigger.
To modify a metrics-based Trigger:
Use these examples as a starting point for building your own metrics-based Triggers. Each highlights a common use case and shows how to structure the Trigger query.
Goal: Detect a spike in errors
Calculated Field: my_error_rate RATE($k8s.pod.network.errors)
Trigger Query: AVG(my_error_rate)
Threshold: > 0.05
This configuration alerts when the average error rate across the Environment exceeds 5%.
Goal: Detect a spike in CPU usage
Calculated Field: last_cpu_util LAST($k8s.pod.cpu.utilization)
Trigger Query: AVG(last_cpu_util)
Threshold: > 0.9
This configuration tracks the most recent CPU utilization across containers and alerts when it rises above 90%.
It uses LAST()
to get the most recent sample for each container.
Goal: Detect sustained high request volume
Calculated Field:incr_requests INCREASE($http.server.requests, 300)
Trigger Query: SUM(incr_requests)
Threshold: > 1000
This configuration alerts when total requests in the last 5 minutes exceed 1000.
Metrics-based Triggers are still in development and come with a few key constraints:
RATE()
or INCREASE()
directly inside aggregations like SUM()
or AVG()
.
Instead, define them in query-scoped Calculated Fields and reference those in your Trigger’s query.Metrics-based and event-based Triggers share a similar setup process, but they behave differently in how they evaluate data and support configuration.
Feature | Metrics-Based Triggers | Event-Based Triggers |
---|---|---|
Temporal Aggregation | Via Calculated Fields only | Not applicable |
Query Preview | One bucket only; no 16x view | 16x historical preview |
Templates | Not supported | Supported |
Granularity Selector in UI | Available | Not Applicable |