build.gradle.kts 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. plugins {
  2. id("otel.javaagent-instrumentation")
  3. }
  4. muzzle {
  5. pass {
  6. group.set("io.opentelemetry")
  7. module.set("opentelemetry-api")
  8. versions.set("[0.17.0,)")
  9. skip("0.13.0") // has a bad dependency on non-alpha api-metric 0.13.0
  10. skip("0.9.0") // has no pom file in maven central
  11. assertInverse.set(true)
  12. }
  13. }
  14. dependencies {
  15. // this instrumentation needs to be able to reference both the OpenTelemetry API
  16. // that is shaded in the bootstrap class loader (for sending telemetry to the agent),
  17. // and the OpenTelemetry API that the user brings (in order to capture that telemetry)
  18. //
  19. // since (all) instrumentation already uses OpenTelemetry API for sending telemetry to the agent,
  20. // this instrumentation uses a "temporarily shaded" OpenTelemetry API to represent the
  21. // OpenTelemetry API that the user brings
  22. //
  23. // then later, after the OpenTelemetry API in the bootstrap class loader is shaded,
  24. // the "temporarily shaded" OpenTelemetry API is unshaded, so that it will apply to the
  25. // OpenTelemetry API that the user brings
  26. //
  27. // so in the code "application.io.opentelemetry.*" refers to the (unshaded) OpenTelemetry API that
  28. // the application brings (as those references will be translated during the build to remove the
  29. // "application." prefix)
  30. //
  31. // and in the code "io.opentelemetry.*" refers to the (shaded) OpenTelemetry API that is used by
  32. // the agent (as those references will later be shaded)
  33. compileOnly(project(path = ":opentelemetry-api-shaded-for-instrumenting", configuration = "shadow"))
  34. // using OpenTelemetry SDK to make sure that instrumentation doesn't cause
  35. // OpenTelemetrySdk.getTracerProvider() to throw ClassCastException
  36. testImplementation("io.opentelemetry:opentelemetry-sdk")
  37. testImplementation(project(":instrumentation-api-semconv"))
  38. // @WithSpan annotation is used to generate spans in ContextBridgeTest
  39. testImplementation("io.opentelemetry:opentelemetry-extension-annotations")
  40. testInstrumentation(project(":instrumentation:opentelemetry-annotations-1.0:javaagent"))
  41. }