Closed devurandom closed 4 months ago
@devurandom Hi Dennis, thanks for this! Will take a proper look next time I'm doing batched work on Timbre π No need to worry about rebasing, I'll take care of that during review.
@ptaoussanis Hi Peter! Is there anything I can do to help get this merged?
@devurandom Hi Dennis, apologies for the delay! I would have included this in yesterday's update (v6.4.0), but that was a bit of a rush and mostly intended as a hotfix release.
I've manually merged your PR here, thanks for all the work on this! π
I made a few superficial changes, just to try keep a ~consistent style between the various appenders.
Please let me know if you're happy with that commit, in which case I'll aim to cut a new release in the next few days.
Cheers! :-)
Hi Peter! Thanks! I looked at git diff 39c6e310a62013b694116fd1c66db5b5eb3cd6c0..0bf280901f1174ac7c783dc2f5ff1f8e1ba32e1a -- src/taoensso/timbre/appenders/community/otlp.clj
to review the changes. The code looks good and I noticed no issues.
Re: For agent v2.x: the logs exporter should be enabled by default [1].
By now v2.0 of the Java SDK has been released, so we could just link to its changelog (instead of linking to a GH issue and the changelog with the early notification): https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/v2.0.0/CHANGELOG.md#version-200-2024-01-12
Is there a particular reason you use URL shorteners for links in comments? I imagine they would be inconvenient if they ever become unavailable. It would be hard to figure out what they linked to and also archives would probably only have indexed the original link, but not the shortened one.
Requires com.github.steffan-westcott/clj-otel-api.
With Java Agent
Activate an appender configured by the OpenTelemetry Java Agent:
Note: When relying on the OpenTelemetry Java Agent 1.x, you need to explicitly enable the logs exporter with
OTEL_LOGS_EXPORTER=otlp
. This will become the default with the release of Java Agent 2.0, cf.Without Java Agent
If you want autoconfiguration without the Java Agent, you also need io.opentelemetry/opentelemetry-sdk-extension-autoconfigure and io.opentelemetry/opentelemetry-exporter-otlp on the classpath.
Create an autoconfigured appender and activate it:
If you already have an instance of
GlobalOpenTelemetry
, e.g. created by the OpenTelemetry Java Agent, you need to prevent setting the newly created SDK as the global default:I took inspiration from
taoensso.timbre.appenders.community.sentry
.Once https://github.com/steffan-westcott/clj-otel/issues/8 is implemented, the actual log emission should be replaced with using clj-otel's API.