What is recommended way to send logs to Otel collector?

It seems like GitHub - Nebo15/logger_json: JSON logger formatter with support for Google Cloud, DataDog and other for Elixir. is used a lot, but it is just a formatter, right?

I am not sure why I can not find a single Logger Backend implementation that sends logs to somewhere else, especially to things like Otel collector.

Am I missing something?

1 Like

Hi, @yujonglee :wave:
Sorry for not answering your question directly:
But, logs through Otel in Erlang/Elixir is currently in “experimental” status (see in official Otel page Erlang/Elixir | OpenTelemetry)
You can track opentelemetry_experimental development in here.

I haven’t try it, though, I think currently there is no single success story of what you want, at least I’m not aware of one either. (If there is one - I’like to learn more too :slightly_smiling_face:)

Most of the places I’ve seen are relying on their specific infra setup to deliver logs to their logging application in use (Google Cloud/DataDog/CloudWatch/Loki…). And on the elixir app side only make sure that logs are formatted appropriately and augmented with expected metadata for the logging application.


And just to clarify: “Logger Backends” since elixir 1.15 are deprecated in favor of newer Erlang’s built in :logger api with :logger_filters, :logger_handlers, :logger_formatter etc.
Here more about - Logger Backends and backwards compatibility

1 Like

Thank you.

as @RudManusachi mentioned, elixir’s job is to format the logs and then a different tool is used to send those logs to your collectors.

So you can use for example fluentbit to send the logs to the open telemetry agent or the opentelemetry collector itself