API referenceConsole
observability
Polylane runs PromQL, LogQL and TraceQL through your Grafana datasources, reads the dashboards you trust, and flags alert rules that fire or break.

Connect

Connect Grafana from the terminal. Pass --help for the flags Grafana accepts.

Terminal
polylane integration connect --type grafana

How it works

Alerts start investigations

The Polylane route has no matchers, so it matches every alert. It has continue set to true, so your own routes still get every alert. Alert rules that you create later reach Polylane without more setup.

When an alert group fires, Polylane opens an issue and triages it. Only the alerts of the group that fire decide the triage. More notices of the same alert go to the same issue. A resolved notice goes on the issue timeline, and the agent uses it as evidence.

Every hour, Polylane puts back the contact point and the route if someone removed them. If Grafana refuses the change because of a permission, Polylane stops the hourly sync and tells you. The checks continue. Add the missing role to the same service account, then select Verify under Credentials on the integration page. Polylane then restores alert delivery with the same token.

On the Alerts tab of the integration page, turn automatic triage on or off for the connection or for each alert rule. The tab groups rules by rule group.

Checks

Polylane runs checks on your stack every 30 minutes. Built-in checks count alert instances that fire, alert rules whose last evaluation failed, and alert rules in the NoData state. Polylane also makes a check from each panel query on your dashboards, and from up to ten alert rule queries. Polylane skips a panel whose datasource is not on the stack, and names that datasource. Polylane reads error lines from your Loki application logs to find errors that it did not see before. It also finds signals: queries that watch one business operation, such as a checkout.

Under Anomaly detection on the integration page, change how often the checks run, or turn them off. Polylane also explores the connection when you connect it and every 12 hours, and opens an issue for each problem that it finds.

During an investigation

Agents search dashboards and read their panels, list datasources and check their health, and run PromQL, LogQL, TraceQL, and other datasource queries through the Grafana query proxy. They read alert rules, their live state, and the alerts that fire at that time, and read annotations. Agents can also create annotations, for example for a deploy, and send other Grafana API requests. Each change needs safety review and approval before it runs.

Troubleshooting

  • The stack is unreachable. Grafana Cloud free-tier stacks hibernate after a period without use. Open the stack in your browser once, then try again.
  • Alert delivery needs attention. The service account does not have the Alerting provisioning writer role. Add the role in Grafana, then select Verify under Credentials on the integration page. The Admin basic role of Grafana also includes this role.

Disconnecting

Disconnecting removes the Polylane route from your notification policy tree and deletes the polylane contact point. If the route is in Terraform, remove it at the same time. Then delete the service account token in Grafana.

Disconnect

Disconnecting stops every sync and check and deletes the credentials Polylane held. Everything Polylane set up in Grafana is removed as well; nothing is left behind.

Terminal
polylane integration disconnect <id>

Tools

6

Operations agents can perform in threads.

grafanaApi
Call any Grafana HTTP API endpoint that lacks a dedicated tool
grafanaDashboards
Search Grafana dashboards, read their panel definitions, and list folders
grafanaDatasources
List Grafana datasources and check their health
grafanaQuery
Run a datasource query (PromQL, LogQL, and more) through Grafana
grafanaAlertRules
Read Grafana alert rules, their live state, and firing alerts
grafanaAnnotations
Read or create Grafana annotations to mark events on charts