spicedb
spicedb copied to clipboard
Configure Opentelemetry solely through OTEL_ flags
Overview
I went to get opentelemetry tracing working with our infrastructure. We run an otel sidecar in an ECS context, so the opentelemetry receiver is at http://localhost:4317 and uses the grpc mechanism.
This was what was necessary to get things working:
{ "name" : "SPICEDB_OTEL_PROVIDER", "value" : "otlpgrpc" },
{ "name" : "SPICEDB_OTEL_ENDPOINT", "value" : "localhost:4317" },
{ "name" : "OTEL_EXPORTER_OTLP_ENDPOINT", "value" : "http://localhost:4317" },
Specifying the provider makes sense to me; needing to specify both the SPICEDB_ and OTEL_ versions of the endpoint doesn't. I tested with both individually and neither was sufficient by itself.
Doing this configuration solely through OTEL_-flagged environment variables would make sense to me, as would having maybe a single flag that says "otel tracing is on."
I'm also game for other approaches/solutions; this was just the one that was discussed in discord.
Other background
Discord conversation around this here: https://discord.com/channels/844600078504951838/844600078948630559/1000124099043016814
Now that I'm on the other side of this:
I don't think this is the case anymore. I was able to get a working example with traces flowing through without configuring the otel exporter endpoint separately. I'm not sure what changed in the meantime, but it seems to be working. I'll close this for now.
I got a report that this is still the case. Lemme reopen.
I stumbled across the same problem, one has to set at least provider, otherwise otel will never be initialized/setup (the comment is just wrong here): https://github.com/jzelinskie/cobrautil/blob/f7fe73942d0f2b3254888bde1b9565b6e9226b3d/cobraotel/cobraotel.go#L135-L140