Skip to main content
An alert rule can carry a set of investigation entries. Each entry is a pre-configured jump target: open a dashboard, or open an initial query — already written, and rendered with the alert’s labels — in the Query Workbench. A responder starting from one alert sees the chart or the data they need without writing a query. Entries are configured in the rule form’s sixth section, “Investigation entries” and are saved with the rule. They are rendered into a snapshot at the moment the alert event is produced and travel with the event; changing the rule afterwards does not affect alerts already accepted.
Saving investigation entries requires monit-edge v0.75.3 or later. Saving checks every active instance in the clusters of the data sources the rule matches: if any instance is older than v0.75.3, saving is rejected. See Edge version requirement at save time.

How it works

A rule can hold many investigation entries. Each entry has three parts: the entry type (dashboard or query), the configuration for that type, and a time range relative to the alert event time.
  • An entry is a weak navigation reference. Saving the configuration and rendering the snapshot never run a query and never read the dashboard. Entries do not participate in alert evaluation, alert identity, instance identity or lifecycle, and they trigger no automatic investigation task.
  • An entry follows the event’s data source. A rule can match several data sources by type plus name pattern, but each alert event comes from exactly one of them. A query entry runs on the event’s own data source by default, so the jump lands on the data source that fired the alert rather than on a fixed or default one. You can also name a different data source explicitly (for example to drill into a log data source).
  • Rendering happens when the alert is ingested. When monit-webapi accepts an event, it renders the entries configured on the rule at that moment — using the final event time, the event’s raw data labels and the event data source — into a snapshot (the Investigation Context), which is stored and delivered with the event. The investigation block in the active alert detail drawer, the Investigation block in an incident’s comprehensive info panel (see Incident details) and AI SRE all read that same snapshot.
  • The block has a different name on each side: it is called Investigation entries in Monitors and Investigation in incident details, but both render the same event snapshot.
  • Order affects display only. Entries can be dragged into any order, but the first one carries no default, primary or recommended meaning, and the order never reaches alert evaluation or lifecycle.

Entry types

Neither type supports runbooks, tickets or arbitrary URLs.

Adding and editing entries

Menu path: the alert rule form → section 6, “Investigation entries”.
  1. Click Add dashboard entry or Add query entry to open the entry dialog. The dialog title distinguishes new from existing entries (Add dashboard link / Edit dashboard link / Add query link / Edit query link).
  2. Fill in Purpose and Time range (shared by both types), then the fields for that type.
  3. Click OK to add the entry to the form. OK only adds it to the form; the entry takes effect when you save the rule.
  4. Each row offers three actions: Preview investigation entry (eye icon), Edit (pencil icon) and Delete (trash icon). When you view a saved rule’s details, the edit action becomes Details and the dialog footer offers only Close.
Added entries are listed with a drag handle on the left for reordering. The row title is the Purpose; when no purpose is set, a dashboard entry shows the dashboard title (or the dashboard ID when it cannot be read) and a query entry shows the query. The limit is 20 entries: once you reach 20 the two add buttons become disabled and show Up to 20 investigation entries (see Validation and limits).

Shared fields

Time range semantics:
  • The anchor is the alert event time: start = event time − before, end = event time + after.
  • The window is written into the snapshot exactly as configured, and it never drifts with the current time when you open it later. You can adjust the time range after opening the dashboard or the workbench, but adjustments made in the page are not written back to the rule or to snapshots already produced.
  • An end time in the future is allowed (that is what a non-zero “after” produces): the entry is available as soon as the alert fires, without waiting for later data.
  • The system does not infer, warn about or validate whether the entry’s window covers the alert’s evaluation window.

Dashboard entry fields

Open at failure handling: if the target object no longer exists in the dashboard (deleted or renamed), the field shows Missing object (<id>) together with the warning The selected object no longer exists in the dashboard. The dashboard will open on its default tab. — the jump opens the dashboard’s default tab instead of failing. When the dashboard itself cannot be loaded (deleted, or you have no access), the field area shows Failed to load the dashboard. It may have been deleted or you may not have access. and Open at is not selectable. Variable values rules:
  • A dashboard with no variables shows This dashboard has no variables.
  • Variable values are rendered as Go templates; see Template variables. Datasource variables are marked (datasource) and their placeholder is {{ $datasource.id }}; other variables are prompted with Leave empty to use the dashboard default, e.g. {{ $labels.<variable name> }}.
  • Empty means not configured, and the dashboard applies its own rule for the default. Configured but failing to render, or rendering to an empty string, leaves the variable unresolved (it does not fall back to the default) and shows an error on the entry.
  • A variable that is configured but no longer exists in the dashboard (or was renamed) is still listed and marked No longer in dashboard, so you can clean it up — otherwise it would affect the dashboard’s variable resolution invisibly.
  • Deleting, renaming or changing the type of a variable, or invalidating its candidates, never updates the rule.

Query entry fields

With the event data source selected, a rule type that the workbench does not support shows Choose a datasource type under "Datasource and query" first, or pick a datasource for this entry; an explicitly selected data source that was deleted or that you cannot use shows The selected datasource is unavailable. The data source’s real type, permissions and provider-specific restrictions are re-checked by the workbench as the current user when the entry is opened or run.

Template variables

The template context for investigation entries has exactly two variables:
  • Read a simple label directly: {{ $labels.service }}. For label names containing dots or other special characters, use {{ index $labels "service.name" }}.
  • Accessing a missing label or a key that $datasource does not have fails explicitly (including through index) instead of silently producing an empty string, which would turn into an unfiltered query.
  • The dot (.) only means a local data context such as range / with; it is not the full alert event. Variables available in the Description template such as $values, $value, $annotations and $appendLabels are not available here, and the root object cannot be used to bypass that restriction.
  • Conditionals, loops, local variables and built-in functions of Go templates are supported. The template is rendered once: a {{ }} produced by the rendering is not executed again.
Dashboard variable examples:
Query example (VictoriaLogs):
The query expression owns its quoting and escaping. A template only produces the value itself: the quotes in service:="{{ ... }}" are part of LogsQL syntax and must be written by the expression. When you need escaping, use a function with fixed semantics explicitly — replace (literal replacement), regexQuoteMeta (regex metacharacters), urlquery / html / js — because the system does not infer escaping from the data source dialect. If rendering fails, or the rendered result does not satisfy the query payload requirements, the entry keeps its initial template and the error, and no executable query is produced or run.

Previewing an entry

Click the eye icon on an entry to open the Preview investigation entry dialog, which renders that entry from a real event snapshot so you can confirm the jump before relying on it.
  • Prerequisites: the rule must be saved (otherwise it says Save the rule first, then preview once it has an alert.) and the rule must currently have an active alert (otherwise This rule has no active alerts. Preview will be available once an alert fires.). The dialog picks a sample from the rule’s active alerts, with paging above 20.
  • The preview uses the selected alert’s event snapshot and does not include unsaved changes in the form, so save the rule and wait for it to fire before previewing a new configuration.
  • Clicking an entry in the dialog opens the target in a new tab. If that alert has no snapshot matching this entry, it says This alert has no matching snapshot for this entry. Select an alert generated after the configuration took effect.; if the alert has no snapshot at all, it says This alert has no investigation links. Select an alert generated after the configuration took effect.

Validation and limits

Duplicate identity:
  • Dashboard entries: the same dashboard plus the same target object is a duplicate, regardless of variable values and time range. Duplicates cannot be used to express a variable fallback or multiple instances.
  • Query entries: de-duplicated by the normalized data source, query (mode, expression, arguments, minimum step) and time range; the event data source (no data source named) counts as its own distinct value. Several different queries may be configured on the same data source.
These checks run in two places: in the entry dialog (only the entry being edited, so it can be fixed item by item) and when the rule is saved (the whole set, with the error shown under the section). The API additionally validates that dashboard IDs and target objects are canonical UUIDv7, that variable names are legal and that templates parse, and it rejects unknown fields.

Edge version requirement at save time

Investigation entries require monit-edge v0.75.3 or later. To drive the upgrade, the version gate is enforced at save time; event handling never checks the version:
  • When it applies: the saved rule carries non-empty entries and the request either submitted non-empty entries explicitly, or kept existing entries while changing the data source scope (data source type, name patterns or exact bindings). A rule with no entries, an explicit empty array, and requests that only change other fields are not checked.
  • What it checks: every data source the rule currently matches, and the active instances of the Edge clusters those data sources belong to. Data sources without any active instance are skipped; a rule that matches no data source at all is allowed to save.
  • To pass: every checked instance must be at version v0.75.3 or later. An unrecognizable version counts as failing.
  • On rejection: no field is saved, and the request returns an upgrade error listing the minimum version and the failing data sources, Edge clusters, instance IPs and versions (bounded in number). The message looks like: investigation_targets require monit-edge v0.75.3 or later on every active instance serving the rule's datasources; upgrade cluster "<cluster>" <instance IP>:<port> (v0.75.2).
  • The gate covers every write path: create, update, batch field updates that can change entries or the data source scope, and native-bundle and legacy JSON imports. Rules imported from external formats (Prometheus, Nightingale and so on) always have an empty entry list and are unaffected.
  • After a successful save, a newly added or downgraded low-version instance does not invalidate the saved rule; the check runs again only when you next submit entries or change the data source scope.

Snapshot semantics and failures

Entries come from the event snapshot, not from the rule’s current configuration. They are rendered once when the alert is accepted, and afterwards:
  • If you change the entries on the rule, alerts already accepted (active alert details, the Investigation block on an incident) keep showing the old snapshot;
  • Repeat notifications and terminal events reuse the same snapshot, shifting each entry’s window by the difference in event time; the rule is not read again;
  • Deleting the rule does not remove historical snapshots — the incident side then shows The alert rule was deleted, so no investigation entries were generated.
Alerts accepted before the configuration took effect have no snapshot. An alert produced before you saved the entries shows This alert has no investigation links. Select an alert generated after the configuration took effect. in its details. Verify with alerts produced after the configuration took effect. When the whole event fails to render, no snapshot is produced and a bounded error code is delivered instead: A single entry failing to render does not drop it. When a dashboard variable fails to render, that variable stays unresolved and shows Variable <name> failed to render: <reason>; when a query fails to render, the entry produces no executable query and is not run, and shows Query failed to render and was not run: <reason>. Such entries are still listed, carry a red Entry error label, and give no link. The remaining entries work normally. Permissions are re-checked at the destination. A snapshot’s visibility follows the alert event itself and is not filtered by dashboard folder or data source permissions when it is generated; opening the dashboard or the workbench re-authorizes as the current user, and a target that no longer exists or that you cannot access reports the destination’s own error rather than falling back to another resource. A snapshot delivered to On-call has a separate 8 KiB limit. The full snapshot travels with the alert event as the __alert_rule_investigation_context label; when the label value exceeds 8 KiB it is degraded as a whole to payload_limit (the incident shows a notice, not a truncated snapshot), and the full snapshot remains available in the active alert details in Monitors.

Active alerts

The investigation block in the active alert detail drawer renders entries from the event snapshot.

Incident details · Investigation

How the Investigation block renders the snapshot in an incident’s comprehensive info panel.

Description template

Go Template variables for alert descriptions, whose context differs from investigation entries.

Monitors quickstart

An overview of the alert rule form’s six sections.