When configuring alloy on a server (/etc/alloy/config.alloy), i have a configuration for remotecfg, in addition to prometheus.remote_write.metrics_service and loki.write.grafana_cloud_loki. This is setup and configured via Fleet Management in Grafana Cloud.
However, when adding configurations via fleet management, the components from the config.alloy file cannot be resolved. The error looks like: ts=2025-06-01T21:11:38.432336642Z level=error msg=“failed to fetch remote configuration from the API” service=remotecfg err=“26:17: component "loki.write.grafana_cloud_loki.receiver" does not exist or is out of scope”.
It doesn’t seem that it is possible to reference components from the config.alloy config file. Can anyone confirm this? Is there a way around this?
Outside of the simple use case of not duplicating components unnecessarily, being able to reference components defined locally is incredibly useful when adding labels specific to that host.
For example, via external_labels on the loki.write and/or prometheus.remote_write components.
Is there a workaround for this? Adding labels that are specific to the host, for all collections (metrics and logs) exported from that host?