Show the Monitoring tab on a component
Each annotated component gets a Monitoring tab: the Grafana alerts that concern it and the panels of its Grafana dashboard, drawn by Astrolabe.
Two steps: turn on the plugin, annotate the component.
What the tab shows, and to whomβ
At the top, four period buttons: 1 h, 6 h, 24 h and 7 d. 24 h is selected when you open the tab.
Under Alerts, a table with one line per alert rule:
| Column | What |
|---|---|
| State | The state of the rule |
| Rule | The name of the rule |
| Severity | Its severity |
| Summary | Its summary |
Below, the panels of the dashboard named by the component.
Anyone who can open the component sees the tab. Astrolabe reads Grafana with the token of the integration, the same for everyone.
1. π Turn on the pluginβ
-
In Administration, under PLATFORM, click Plugins.
-
On the Grafana card, turn on the switch at the top right.
If the card says Requires the Premium license, the switch is grey: Grafana is part of the Premium license. Click the line, add a license that covers it, then come back to this step.
If the card says Configure the Grafana integration first, click it: the integration opens in Company connections. Add it (Add the Grafana integration). The plugin turns on by itself when you save the integration: go to step 2.
The card has no settings: Grafana is entered once, in the integration.
2. π·οΈ Annotate the componentβ
In the catalog-info.yaml file of the component, add one or both of these annotations. One is
enough to show the tab.
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: shop-api
annotations:
grafana/dashboard: shop-api-overview
grafana/alert-label-selector: service=shop-api
spec:
type: service
lifecycle: production
owner: team-a
| Annotation | What to write | Example |
|---|---|---|
grafana/dashboard | The UID of the dashboard: in Grafana, the part after /d/ in its address | shop-api-overview |
grafana/alert-label-selector | A label of your alert rules, as name=value | service=shop-api |
grafana/panels | Optional. The ids of the panels to draw, separated by commas. Leave it out to draw every panel | 2,4 |
grafana/variables | Optional. Values for the variables of the dashboard, as name=value, separated by commas | env=prod |
The drawing of the panels was not checked on a live instance.
β Checkβ
Open the component in Catalog. A Monitoring tab is in the tab bar, next to Overview. Click it: the alerts table and the period buttons are there.
β That's it!
Something is wrong? See Common problems with Grafana.