Creating a metrics-based Trigger
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:- Select Triggers () from the navigation menu.
- Select New Trigger.
- In the modal that appears, select the Metrics dataset.
- Define the Trigger query:
- Enter a name and description.
- Select fields from your metrics dataset.
- Optionally, use query-scoped Calculated Fields to apply temporal aggregation functions like
RATE()orINCREASE(), which compute change over time. Example:my_rate_dc RATE(http_requests_total). - Ensure the query returns a single scalar value, not a time series.
- Most queries start with a temporal aggregation function wrapped in a spatial aggregation like
SUM()orAVG(). Example:SUM(my_rate_dc). - You can also use spatial aggregations alone on metrics. In this case, Honeycomb applies a default temporal aggregation function based on the metric’s metadata as described in Applying Temporal Aggregation Functions: Default Behavior.
- Most queries start with a temporal aggregation function wrapped in a spatial aggregation like
- Set threshold conditions and choose where to send notifications.
- Select Create Trigger to save.
Modifying a Metrics-Based Trigger
You can modify a metrics-based Trigger the same way you edit an event-based Trigger. To modify a metrics-based Trigger:- Select Triggers () from the navigation menu.
- Find the Trigger you want to update, and select its name.
- In the editor, adjust the query, threshold, or notification settings as needed.
- Select Save Trigger to apply your changes.
You cannot change a Trigger’s dataset after it has been created.
To use a different dataset, create a new Trigger.
Examples
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.Compare Metrics-Based and Event-Based Triggers
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 |