opentelemetry-api-beta.gradle 1.8 KB

1234567891011121314151617181920212223242526272829
  1. apply from: "$rootDir/gradle/instrumentation.gradle"
  2. dependencies {
  3. // this instrumentation needs to be able to reference both the OpenTelemetry API
  4. // that is shaded in the bootstrap class loader (for sending telemetry to the agent),
  5. // and the OpenTelemetry API that the user brings (in order to capture that telemetry)
  6. //
  7. // since (all) instrumentation already uses OpenTelemetry API for sending telemetry to the agent,
  8. // this instrumentation uses a "temporarily shaded" OpenTelemetry API to represent the
  9. // OpenTelemetry API that the user brings
  10. //
  11. // then later, after the OpenTelemetry API in the bootstrap class loader is shaded,
  12. // the "temporarily shaded" OpenTelemetry API is unshaded, so that it will apply to the
  13. // OpenTelemetry API that the user brings
  14. //
  15. // so in the code "unshaded.io.opentelemetry.*" refers to the (unshaded) OpenTelemetry API that
  16. // the user brings (as those references will be translated during the build to remove the
  17. // "unshaded." prefix)
  18. //
  19. // and in the code "io.opentelemetry.*" refers to the (shaded) OpenTelemetry API that is in the
  20. // bootstrap class loader (as those references will later be shaded)
  21. compileOnly project(path: ':opentelemetry-api-beta-shaded-for-instrumenting', configuration: 'shadow')
  22. compileOnly project(path: ':opentelemetry-auto-annotations-beta-shaded-for-instrumenting', configuration: 'shadow')
  23. // using OpenTelemetry SDK to make sure that instrumentation doesn't cause
  24. // OpenTelemetrySdk.getTracerProvider() to throw ClassCastException
  25. testImplementation project(path: ':opentelemetry-sdk-beta-shaded-for-instrumenting', configuration: 'shadow')
  26. testImplementation project(path: ':opentelemetry-auto-annotations-beta-shaded-for-instrumenting', configuration: 'shadow')
  27. }