Skip to main content

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:

ColumnWhat
StateThe state of the rule
RuleThe name of the rule
SeverityIts severity
SummaryIts 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​

  1. In Administration, under PLATFORM, click Plugins.

  2. 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
AnnotationWhat to writeExample
grafana/dashboardThe UID of the dashboard: in Grafana, the part after /d/ in its addressshop-api-overview
grafana/alert-label-selectorA label of your alert rules, as name=valueservice=shop-api
grafana/panelsOptional. The ids of the panels to draw, separated by commas. Leave it out to draw every panel2,4
grafana/variablesOptional. Values for the variables of the dashboard, as name=value, separated by commasenv=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.