Self-monitoring pipelines
The first time you access the Grafana Fleet Management interface in Grafana Cloud, a set of configuration pipelines is autogenerated.
These autogenerated pipelines, whose names begin with self_monitoring_*
, collect important internal metrics and real-time logs from registered collectors and send them to Grafana Cloud.
This internal telemetry populates the preinstalled dashboards and log displays in Fleet Management so you can centrally monitor the health of your fleet.
Environment variables
The self-monitoring pipelines rely on environment variables to authenticate to the Fleet Management service and assign data to the correct collector.
- If you installed Alloy and enabled Fleet Management using the Grafana Cloud Alloy Install workflow, the workflow command exports the necessary variables for you.
- If you enabled Fleet Management on existing collectors or installed Alloy using other methods, make sure to export the following environment variables wherever Alloy is running.
GCLOUD_RW_API_KEY
The GCLOUD_RW_API_KEY
variable represents an access token that authenticates to Fleet Management, reads Alloy configuration, and writes to the relevant database.
The token should have the following scopes for health metrics and logs to appear in Fleet Management:
fleet-management:read
metrics:write
logs:write
Add these additional scopes if you want to use the same access token for all telemetry:
traces:write
profiles:write
Note
You can generate a token with the correct scopes by going to the Connections > Collector > Configure page in Grafana Cloud.
GCLOUD_FM_LOG_PATH
(MacOS only)
The GCLOUD_FM_LOG_PATH
variable is used in the self_monitoring_logs_macos
pipeline.
If you are collecting logs from a collector running on MacOS, set this variable to the absolute path of the Alloy log file.
Troubleshoot lack of self-monitoring data
If you’ve registered collectors and exported the necessary environment variables, but you don’t see data in the dashboards or logs display in Fleet Management, refer to the following pages for tips on how to troubleshoot: