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:

  1. Click the API tab.

  2. Make note of the Fleet Management service Base URL.

  3. Make note of the Instance ID.

  4. Open the Grafana Alloy configuration file on the machine where Alloy runs.

  5. Copy the following remotecfg code block and paste it at the end of the config.alloy file.

    Alloy
    remotecfg {
        url = "<SERVICE_URL>"
        basic_auth {
            username      = "<USERNAME>"
            password      = "<PASSWORD>"
        }
    
        id             = constants.hostname
        attributes     = {"cluster" = "dev", "namespace" = "otlp-dev"}
        poll_frequency = "5m"
    }
  6. Set url to the Fleet Management service URL, username to the instance ID, and password to the access token you created in the previous milestone.

  7. Save your changes to the Alloy configuration file.

  8. Add GCLOUD_RW_API_KEY = "<Enter-access-policy-token>" to the Grafana Alloy service environment variables file. For macOS, also set GCLOUD_FM_LOG_PATH = $PWD/alloy.log.

  9. Save your changes to the environment variables file and restart the Grafana Alloy service.

  10. 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:

Were you successful?


page 5 of 9