pydantic / logfire

Uncomplicated Observability for Python and beyond! 🪵🔥
https://docs.pydantic.dev/logfire/
MIT License
1.91k stars 54 forks source link

Do not require auth if using custom exporters #298

Closed astrojuanlu closed 1 month ago

astrojuanlu commented 2 months ago

Description

I tried Logfire for the first time and the UI looks so beautiful ✨

I then tried to set up a custom exporter using Jaeger as follows:

export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4318/v1/traces

and the following docker-compose.yaml:

services:
  jaeger:
    image: jaegertracing/all-in-one:1.58
    ports:
      - "4318:4318"
      - "16686:16686"

As expected, the logs were sent to my local Jaeger instance, and not to the Logfire UI. However, it still required me to do logfire auth and set up an empty project.

I then tried export LOGFIRE_SEND_TO_LOGFIRE=0 and it did not ask me to auth, but also it didn't send the traces to Jaeger.

Am I missing something? And if indeed this is not yet possible, would you folks consider enabling that use case?

alexmojaki commented 1 month ago

You're not missing anything, this is a mistake on our part.

S4mpl3r commented 1 month ago

@alexmojaki Is it possible for you guys to put up a guide for using logfire sdk with a local backend solution? I've been trying the beta and am very impressed, but I'd like to be able to send my data to my own servers in production.

astrojuanlu commented 1 month ago

@S4mpl3r it's not a guide, but in https://github.com/pydantic/logfire/issues/298#issue-2386213778 I wrote the steps I followed

S4mpl3r commented 1 month ago

@astrojuanlu Yeah I've seen your comment and I'll be trying that out, but an 'official' guide of sorts will be worth the effort as I'm sure a lot of other developers will be looking for such a solution.

alexmojaki commented 1 month ago

@astrojuanlu @S4mpl3r @joaoflaviosantos @mastizada @gustavosett I've started work on a fix for this in https://github.com/pydantic/logfire/pull/350. As I've explained there it's tricky to design user-friendly behavior, would love to hear everyone's perspectives.

alexmojaki commented 1 month ago

OK, if you upgrade to the newest release (0.50.0) you should be able to do this sanely. Just set OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4318/v1/traces. I think leave out the OTEL_EXPORTER_OTLP_ENDPOINT or it will try to also send metrics to Jaeger and log errors about that.

It will still also send to Logfire by default, so set LOGFIRE_SEND_TO_LOGFIRE=0 if you don't want to send to both.

Full docs here: https://docs.pydantic.dev/logfire/guides/advanced/alternative_backends/

S4mpl3r commented 1 month ago

Yes, thank you!