imandra-ai / ocaml-opentelemetry

Instrumentation for https://opentelemetry.io
http://docs.imandra.ai/ocaml-opentelemetry/
33 stars 7 forks source link

Should we handle redirection #39

Open tatchi opened 1 year ago

tatchi commented 1 year ago

I was testing the cohttp client with the jaeger all in one image. I set http://localhost:4318/ as the config.url, which makes the client to send traces to http://localhost:4318//v1/traces (notice the double //. Also see https://github.com/imandra-ai/ocaml-opentelemetry/pull/38).

I didn't notice any errors in the terminal, but no traces showed up. It turns out that this is because a 301 redirect to /v1/traces was returned, and we do not handle redirects in the code.

I think we should handle redirects or at least fail/log something out to the console. wdyt?

c-cube commented 1 year ago

I think the ocurl backend does handle redirections. But good point about the cohttp client.

And yes, logging to stderr is a good idea. :+1: