Grafana Cloud
Connect
Connect Grafana Cloud from the terminal. Pass --help for the flags Grafana Cloud accepts.
polylane integration connect --type grafanaA stack URL and a service account token with the Editor role.
Connect Grafana Cloud so agents can read your dashboards, query your datasources, and inspect Grafana alerting.
Setup
- Find your stack URL in the Grafana Cloud portal, like https://yourstack.grafana.net.
- In your Grafana stack, open Administration → Users and access → Service accounts.
- Create a service account with the Editor role. Editor lets agents read dashboards, query datasources, and create annotations, and lets Polylane subscribe to your Grafana alerts.
- Add a token to the service account and paste both values into Polylane. Polylane validates them against your stack and connects.
Your token is encrypted before it is stored, and the agent never sees it.
Grafana Cloud free-tier stacks hibernate after inactivity. If validation reports the stack is unreachable, open it in your browser once and retry.
Alerts and continuous monitoring
On connect, Polylane provisions a webhook contact point in your stack and adds a catch-all route to your notification policy tree. The route matches every alert and continues to your existing routes, so your current delivery is untouched, and alert rules you create later notify Polylane automatically. Firing alerts land in your workspace, get triaged, and can start investigations.
Polylane also reads every dashboard and runs each panel query continuously as an anomaly check, and discovers key queries for signals your dashboards miss.
What agents can do
- Search dashboards and read their panel definitions and queries
- List datasources and run health checks
- Run PromQL, LogQL, TraceQL, and other datasource-native queries through Grafana's query proxy
- Inspect alert rules, their live state and health, and the alerts firing right now
- Read chart annotations, and create new ones for deploys and incident windows
Disconnecting
Disconnect Grafana Cloud in Polylane; it removes the contact point and notification policy route it provisioned. Then delete the service account token in Grafana. If the route is in Terraform, drop it at the same time.
Register Grafana Cloud alerts to Polylane alongside your Terraform-managed resources.
An hourly reconciliation keeps the polylane contact point and its catch-all policy route in place. The grafana_notification_policy resource manages the entire policy tree, so a Terraform apply that omits the route removes it and the reconciliation adds it back. Carry the route as the first policy in your tree, with continue = true so your own routes still receive everything, and leave the contact point itself to Polylane:
resource "grafana_notification_policy" "tree" {
# ...
policy {
contact_point = "polylane"
continue = true
}
# your existing routes follow
}
Alert rules need no per-rule setup: the route matches every alert. Disconnecting the integration removes the contact point and the route, so drop the route from Terraform configs at the same time.
Disconnect
Disconnecting stops every sync and check and deletes the credentials Polylane held. Everything Polylane set up in Grafana Cloud is removed as well; nothing is left behind.
polylane integration disconnect <id>Tools
6Operations agents can perform in threads.