diff --git a/docker/telemetry/docker-compose.grafanacloud.yaml b/docker/telemetry/docker-compose.grafanacloud.yaml index b78f188d53..ffd7f5fe68 100644 --- a/docker/telemetry/docker-compose.grafanacloud.yaml +++ b/docker/telemetry/docker-compose.grafanacloud.yaml @@ -22,6 +22,10 @@ services: # Mount the Grafana Cloud collector config over the default path # (replaces local-only config for this run; file on disk untouched). - ./otel-collector-config.grafanacloud.yaml:/etc/otel-collector-config.yaml:ro + # Override the base filelog-storage overlay with the cloud variant. The + # collector replaces service.extensions on merge, and the base variant + # omits basicauth/grafanacloud, which stops the cloud exporter starting. + - ./otel-collector-filestorage.grafanacloud.yaml:/etc/otel-collector-filestorage.yaml:ro # Secrets from the env file, injected as container env and # resolved by the collector via ${env:...}. env_file: diff --git a/docker/telemetry/otel-collector-filestorage.grafanacloud.yaml b/docker/telemetry/otel-collector-filestorage.grafanacloud.yaml new file mode 100644 index 0000000000..fe0cfd83e4 --- /dev/null +++ b/docker/telemetry/otel-collector-filestorage.grafanacloud.yaml @@ -0,0 +1,26 @@ +# Filelog offset persistence for the Grafana Cloud stack. +# +# Same purpose as otel-collector-filestorage.yaml, and needed for the same +# reason, but it cannot be reused as-is. The collector replaces lists on merge +# rather than appending, so whichever config is passed last decides +# service.extensions outright. The base variant repeats the base config's list, +# [health_check, file_storage/filelog], which drops basicauth/grafanacloud and +# leaves the cloud exporter unable to resolve its authenticator -- the collector +# then exits at startup with "authenticator not found" rather than degrading. +# +# Applied by docker-compose.grafanacloud.yaml, which mounts it over the base +# variant so the command line stays unchanged. + +extensions: + file_storage/filelog: + directory: /var/lib/otelcol/file_storage + create_directory: true + +receivers: + filelog: + storage: file_storage/filelog + +# Must name every extension the cloud config needs, not just this file's own: +# lists are replaced, so anything omitted here is omitted from the collector. +service: + extensions: [health_check, file_storage/filelog, basicauth/grafanacloud]