Register a collector with Grafana Fleet Management
In this milestone, you register a collector in Fleet Management by adding the remotecfg code block to the Grafana Alloy configuration file.
You can set attributes for a collector in both the remotecfg block and the Fleet Management user interface. Attributes describe the collector’s purpose or environment, such as role, environment, cluster, or team.
To register a collector with Fleet Management, complete the following steps:
Click the API tab.
Make note of the Fleet Management service Base URL.
Make note of the Instance ID.
Open the Grafana Alloy configuration file on the machine where Alloy runs.
Copy the following
remotecfgcode block and paste it at the end of theconfig.alloyfile.remotecfg { url = "<SERVICE_URL>" basic_auth { username = "<USERNAME>" password = "<PASSWORD>" } id = constants.hostname attributes = {"cluster" = "dev", "namespace" = "otlp-dev"} poll_frequency = "5m" }Set
urlto the Fleet Management service URL,usernameto the instance ID, andpasswordto the access token you created in the previous milestone.Save your changes to the Alloy configuration file.
Add
GCLOUD_RW_API_KEY = "<Enter-access-policy-token>"to the Grafana Alloy service environment variables file. For macOS, also setGCLOUD_FM_LOG_PATH = $PWD/alloy.log.Save your changes to the environment variables file and restart the Grafana Alloy service.
Return to the Inventory tab and confirm that the collector you registered is listed.
In the next milestone, you learn how to view the health status of a collector.
More to explore (optional)
At this point in your journey, you can explore the following paths:
Troubleshooting
Explore the following troubleshooting topics if you need help:
Please tell us what didn't work: