elastic / elastic-otel-java

Apache License 2.0
14 stars 12 forks source link

Generate class exposing version for libraries #240

Closed JonasKunz closed 5 months ago

JonasKunz commented 5 months ago

Because we publish our extensions as standalone extensions, it theoretically is possible to end up with different versions of the individual libraries on the classpath. Therefore it is useful to log (or somehow expose, e.g. as the tracer version) the exact library version used.

This was already implemented for inferred-spans by generating a textual resource containing the version. The way this was implemented was brittle though, as I broke it by removing all other resources while upgrading to async-profiler 3.

This PR makes accessing the version simpler to use by letting gradle generate a java source exposing the project version. I've added this functionality to our library-packaging-convetions to make it available to all our libraries.