For anyone else struggling with this, here’s the combination of configuration that worked for me:
I used the region-based tempo URL like tempo-us-central1.grafana.net:443.
I used the numeric user ID, like 123456 from https://<ORG_NAME>.grafana.net/datasources/edit/grafanacloud-traces labeled “User” under the “Basic Auth Details” section as the basic auth username.
I used an API key created at https://grafana.com/orgs/<ORG_NAME>/api-keys with MetricsPublisher role as the basic auth password.
// The "OTEL_EXPORTER_OTLP_HEADERS" key needs to be exact
process.env.OTEL_EXPORTER_OTLP_HEADERS = `Authorization=Basic ${Buffer.from(
process.env.GRAFANA_TEMPO_BASIC_AUTH_USERNAME +
':' +
process.env.GRAFANA_TEMPO_BASIC_AUTH_PASSWORD,
).toString('base64')}`;
return new opentelemetry.NodeSDK({
traceExporter: new OTLPTraceExporter({
url: process.env.GRAFANA_TRACE_ENDPOINT,
}),
instrumentations,
});
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-grpc';
Also, I needed to use the @opentelemetry/exporter-trace-otlp-grpc package instead of the @opentelemetry/exporter-trace-otlp-proto package.