You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am not a maintainer of OpenTelemetry, but my understanding is that the examples you gave are self-sufficient appenders, whereas OpenTelemetryAppender is supposed to act like a bridge between the logging framework and the instrumentation ecosystem. The appender itself does not know where to export the logs – that should be configured downstream in the SDK instance, hence the connection must be made somehow.
You can, however, access the logging configuration in runtime and tweak it by adding OpenTelemetryAppender, like in the linked issue's discussion. I know, this is not ideal, since it affects the logging system globally and needs to be synchronized across workloads, but may be useful in single-job clusters or with orchestrated workloads.
You are right about just opentelemetry-log4j-appender-2.17 being not enough to implement exporting to specific endpoint and needing extra libraries, but if for example it would configure itself to use the static GlobalOpenTelemetry.get(), then you could add the opentelemetry-exporter-otlp JARs and the rest would be configurable via -Dotel.exporter.otlp.* properties:
Is your feature request related to a problem? Please describe.
In some applications, for example Spark, it is not trivial to add arbitrary initialization code running on startup:
https://spark.apache.org/docs/3.5.1/configuration.html#configuring-logging
As this appender forces you to write Java code, this makes it hard to plug it into Spark, if not impossible:
https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/instrumentation/log4j/log4j-appender-2.17/library#usage
Describe the solution you'd like
I would like the OpenTelemetry installation to be possible via log4j configuration.
Here is an example of it from another plugin:
https://github.com/tkowalcz/tjahzi/tree/master/log4j2-appender
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: