1

Im trying to use the OTLPSpanExporter (either the http or grpc) version to send traces to tempo cloud but i wasn't able to find any documentation on how to add the authentication.

tempo cloud screenshot

I tried something like this but i get constants error saying that the headers key's are invalid if im using the grpc version and 404 using the http version. I also tried without the the /tempo path and different variations i found like '/v1/traces' but i was also getting 404 everytime.

otlp_exporter = OTLPSpanExporter(
    endpoint="https://tempo-us-central1.grafana.net", 
    headers={
        "Content-Type": "application/json",
        "Authorization": f"Basic {urllib.parse.quote_plus('XXXX')}",
    }
)

Has anyone managed to implement this?

Marco
  • 1,112
  • 1
  • 14
  • 34
  • Hello Marco, I am facing the same error. I am trying to send traces directly to grafana cloud's tempo instance without agent. I am keep getting 404. Grafana instance's tempo url looks like this : https://.grafana.net:443 – Utsav Chokshi Jul 05 '23 at 23:13
  • I am using otel library in python. Just wanted to know if it is possible or not. – Utsav Chokshi Jul 05 '23 at 23:14

1 Answers1

0

Grafana Data Source settings is for Grafana, not for OTLP exporter. Grafana uses different protocol (HTTP) as OTLP exporter (GRPC). So use config for Agent (agent is OTEL collector under the hood, so there is also OTLP exporter). So endpoint is tempo-us-central1.grafana.net:443.

You are using GRPC protocol, not HTTP protocol, so header "Content-Type": "application/json" doesn't make sense. (In theory it is possible to use HTTP protocol, but then you will need HTTP exporter and not GRPC + it is not clear if Grafana cloud support also HTTP protocol for trace ingestion).

Authorization header is Authorization (not Authentication as you mentioned https://community.grafana.com/t/send-traces-to-tempo-cloud-from-open-telemetry-in-python/77431). It is not clear what are you using instead of XXXX but that must be base64 of <your user id>:<your api key>. That's standard basic auth - https://en.wikipedia.org/wiki/Basic_access_authentication#Client_side

Jan Garaj
  • 25,598
  • 3
  • 38
  • 59