Links and annotations
In the monitor editor, Annotations hold text notes such as runbook summaries. Links hold URL-valued annotations that Observability Platform renders as clickable links on monitor and alert detail pages. Link names become annotation keys. They must use only letters, numbers, and underscores, and can’t start with a number. When the Links section is enabled in the monitor editor, Observability Platform displays URL-valued annotations from existing monitors in Links rather than in Annotations. Saving the monitor preserves those entries inannotations.
SLOs also support the Links section in the SLO Definition drawer when
this feature is enabled. SLO links use the same link types but don’t interpolate
template variables during editing because SLOs have no live preview signal. See
Labels and annotations for the
separate SLO annotations workflow.
Add links to a monitor
Add dashboard, log, or external links in the monitor editor Links section, or set URL-valued entries on the monitor’sannotations map when you define the
monitor in code. Select the tab for your workflow.
In the Chronoctl, Terraform, and API tabs, a Pod restarts monitor includes two
templated links in annotations: dashboard and error_logs. The sample values
in this section match those code examples. Replace TENANT with your tenant
subdomain. For DASHBOARD_SLUG, open the dashboard,
click Copy URL in the page header, and use the path
segment after /dashboards/. For template syntax and URL patterns, see
Construct link URLs.
Value for the dashboard annotation:
error_logs annotation URL:
- Web
- Chronoctl
- Terraform
- API
- Create or edit a monitor.
- In the Links section, click Add link.
- Enter a Link name.
- Select a link type:
- URL: Enter a full URL or a relative path to a page in Observability Platform. Use this type for external runbooks, status pages, and other links. See Construct link URLs for URL patterns.
- Dashboard: Select a dashboard from the autocomplete. Observability Platform maps dashboard variables to alert signal labels so the link opens a view scoped to the alerting dimensions. Add or remove variable mappings as needed.
- Logs: Enter a logging query. Observability Platform builds a Logs Explorer URL from the query. Use template variables in the query to scope results to each alerting signal. See Construct link URLs for query patterns. The Logs type is available only when your tenant has a logging data source. If logging isn’t enabled, the drawer accepts URL and Dashboard links only.
- Review the Link preview as you type. The preview updates to show the link Observability Platform stores on the monitor.
- Click Create to add the link to the table, then click Save on the monitor form to persist your changes.
- To edit a link, click the edit icon. In the Edit link page, make any necessary changes and then click Save.
Construct link URLs
Reference labels from the alerting time series with Prometheus Alertmanager template syntax. Observability Platform expands variables when an alert triggers and when responders view links on alert detail pages. Use either of these forms to read a label from the alerting series:{{ $labels.LABEL }}{{ .Labels.LABEL }}
LABEL with the label name, such as namespace or
chronosphere_k8s_cluster.
Labels referenced in a template must be present on the alerting time series. Missing
labels display as the template string, such as {{ $labels.missing_label }}.
the variable renders as empty in the expanded link.
For a full list of alerting variables and templating functions, see the
Alertmanager documentation.
Dashboard links
Select Dashboard as the link type to scope a dashboard to the alerting signal. Choose a dashboard from the Dashboard name dropdown. For native dashboards, Observability Platform populates Dashboard variables with the dashboard’s configured variables and maps each to a signal label using${LABEL} tokens. For
classic (Grafana) dashboards, an info banner indicates that variables aren’t
available from the dashboard configuration.
Click + Add variable to add custom variable mappings. Click a variable’s
Values field to select from available signal labels, or type a literal value.
Edit or delete existing variable mappings as needed. The Link preview updates as
you configure variables, showing the constructed URL with interpolated template
variables where signal labels are available.
Omit start, end, from, and to from dashboard and Logs Explorer URLs when
you want the alert page’s time range to apply when a responder clicks the link.
If the URL already includes any of those parameters, Observability Platform leaves
them unchanged.
Logs links
When you use the Logs link type in the monitor editor, enter the query in plain logging query syntax and embed template variables where you want per-signal values. The sample logs query in Add links to a monitor is what theerror_logs annotation encodes in Chronoctl, Terraform, and API definitions.
Observability Platform encodes the query into a Logs Explorer URL and preserves
{{ ... }} expressions for expansion at alert time.
To construct a logs URL manually instead, see
Create links to log data.
