-
Notifications
You must be signed in to change notification settings - Fork 864
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log4J appender open telemetry installation should be possible via log4j config #12468
Comments
This comment was marked as spam.
This comment was marked as spam.
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
|
Makes sense, could possibly work with |
Also, right now the JAR of |
this was added to resolve #11499, can you provide some more details about the issue it's creating? thanks |
As I understand, the |
cc @jeanbisutti |
In this way, you have to be sure that GlobalOpenTelemetry.set is called before with a non-null instance of |
I have downloaded the It contains a |
I have just checked and I was wrong: it is not supposed to be unique, so its existence does not break anything: But it is still useless, I guess. |
I got why this was a problem in my case: when building a single fat jar there are going to be no duplicate resources and this one shadows mine. |
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: