The documentation pages should be up to date, but note that how things are configured might differ depending on what you are using. I’ll change the doc to make this clear.
When using the collector, you don’t need the final part of the URL, which is signal-specific. There, “https://otlp-gateway-prod-us-central-0.grafana.net/otlp” will work. In other places, when dealing with signal-specific configuration, you’ll need a suffix like “/v1/metrics” or “/v1/traces”.
From your message, it’s not clear to me what you are trying to configure, but I just tried the following Collector configuration against an account of mine and confirmed that it works:
extensions:
basicauth:
client_auth:
username: "${env:GRAFANA_CLOUD_USER}"
password: "${env:GRAFANA_CLOUD_TOKEN}"
processors:
batch:
receivers:
otlp:
protocols:
grpc:
exporters:
otlphttp:
endpoint: https://otlp-gateway-prod-us-central-0.grafana.net/otlp
auth:
authenticator: basicauth
service:
extensions: [ basicauth ]
pipelines:
traces:
receivers: [ otlp ]
processors: [ ]
exporters: [ otlphttp ]
Note that GRAFANA_CLOUD_USER
is the “Instance ID” that can be found under your “Grafana” settings for the stack, and GRAFANA_CLOUD_TOKEN
is an API key with MetricsPublisher
role.
I used telemetrygen
(https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/cmd/telemetrygen) to send some traces to my collector:
telemetrygen traces --traces 100 --otlp-insecure
And the collector metrics confirmed that data was successfully sent:
$ curl -s localhost:8888/metrics | grep otelcol_exporter_sent_spans
# HELP otelcol_exporter_sent_spans Number of spans successfully sent to destination.
# TYPE otelcol_exporter_sent_spans counter
otelcol_exporter_sent_spans{exporter="otlphttp",service_instance_id="aa54b8a3-ddc5-49a2-a6e8-c03b916330a0",service_name="otelcol-contrib",service_version="0.87.0"} 200
And finally, I see traces on my Grafana Cloud account: