spicedb icon indicating copy to clipboard operation
spicedb copied to clipboard

Configure Opentelemetry solely through OTEL_ flags

Open reify-tanner-stirrat opened this issue 3 years ago • 3 comments

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

reify-tanner-stirrat avatar Jul 25 '22 22:07 reify-tanner-stirrat

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.

tstirrat15 avatar Dec 10 '24 21:12 tstirrat15

I got a report that this is still the case. Lemme reopen.

tstirrat15 avatar Dec 10 '24 21:12 tstirrat15

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

project0 avatar May 16 '25 08:05 project0