Split out instrumentation-api-semconv (#5721)
* Split out instrumentation-api-semconv * fix tests * Moved LoggingContextConstants to semconv module too
This commit is contained in:
parent
da1dc66512
commit
5fb2261a82
|
@ -6,6 +6,7 @@ plugins {
|
|||
|
||||
dependencies {
|
||||
add("muzzleBootstrap", "io.opentelemetry.instrumentation:opentelemetry-instrumentation-api")
|
||||
add("muzzleBootstrap", "io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-semconv")
|
||||
add("muzzleBootstrap", "io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-annotation-support")
|
||||
add("muzzleBootstrap", "io.opentelemetry.instrumentation:opentelemetry-instrumentation-appender-api-internal")
|
||||
add("muzzleBootstrap", "io.opentelemetry.javaagent:opentelemetry-javaagent-instrumentation-api")
|
||||
|
|
|
@ -21,6 +21,7 @@ dependencies {
|
|||
// Integration tests may need to define custom instrumentation modules so we include the standard
|
||||
// instrumentation infrastructure for testing too.
|
||||
compileOnly("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api")
|
||||
compileOnly("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-semconv")
|
||||
compileOnly("io.opentelemetry.javaagent:opentelemetry-javaagent-instrumentation-api")
|
||||
compileOnly("io.opentelemetry.javaagent:opentelemetry-javaagent-bootstrap")
|
||||
// Apply common dependencies for instrumentation.
|
||||
|
|
|
@ -4,6 +4,7 @@ plugins {
|
|||
|
||||
dependencies {
|
||||
api("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api")
|
||||
api("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-semconv")
|
||||
|
||||
api("io.opentelemetry:opentelemetry-api")
|
||||
|
||||
|
|
|
@ -368,6 +368,7 @@ configurations.configureEach {
|
|||
// what modules they add to reference generically.
|
||||
dependencySubstitution {
|
||||
substitute(module("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api")).using(project(":instrumentation-api"))
|
||||
substitute(module("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-semconv")).using(project(":instrumentation-api-semconv"))
|
||||
substitute(module("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-annotation-support")).using(project(":instrumentation-api-annotation-support"))
|
||||
substitute(module("io.opentelemetry.instrumentation:opentelemetry-instrumentation-appender-api-internal")).using(project(":instrumentation-appender-api-internal"))
|
||||
substitute(module("io.opentelemetry.javaagent:opentelemetry-javaagent-instrumentation-api")).using(project(":javaagent-instrumentation-api"))
|
||||
|
|
|
@ -0,0 +1,59 @@
|
|||
plugins {
|
||||
id("org.xbib.gradle.plugin.jflex")
|
||||
|
||||
id("otel.java-conventions")
|
||||
id("otel.animalsniffer-conventions")
|
||||
id("otel.jacoco-conventions")
|
||||
id("otel.japicmp-conventions")
|
||||
id("otel.publish-conventions")
|
||||
}
|
||||
|
||||
group = "io.opentelemetry.instrumentation"
|
||||
|
||||
dependencies {
|
||||
api("io.opentelemetry:opentelemetry-semconv")
|
||||
api(project(":instrumentation-api"))
|
||||
|
||||
compileOnly("com.google.auto.value:auto-value-annotations")
|
||||
annotationProcessor("com.google.auto.value:auto-value")
|
||||
|
||||
testImplementation(project(":testing-common"))
|
||||
testImplementation("io.opentelemetry:opentelemetry-sdk-metrics")
|
||||
testImplementation("io.opentelemetry:opentelemetry-sdk-testing")
|
||||
}
|
||||
|
||||
tasks {
|
||||
// exclude auto-generated code
|
||||
named<Checkstyle>("checkstyleMain") {
|
||||
exclude("**/AutoSqlSanitizer.java")
|
||||
}
|
||||
|
||||
// Work around https://github.com/jflex-de/jflex/issues/762
|
||||
compileJava {
|
||||
with(options) {
|
||||
compilerArgs.add("-Xlint:-fallthrough")
|
||||
}
|
||||
}
|
||||
|
||||
sourcesJar {
|
||||
dependsOn("generateJflex")
|
||||
}
|
||||
|
||||
val testStatementSanitizerConfig by registering(Test::class) {
|
||||
filter {
|
||||
includeTestsMatching("StatementSanitizationConfigTest")
|
||||
}
|
||||
include("**/StatementSanitizationConfigTest.*")
|
||||
jvmArgs("-Dotel.instrumentation.common.db-statement-sanitizer.enabled=false")
|
||||
}
|
||||
|
||||
test {
|
||||
filter {
|
||||
excludeTestsMatching("StatementSanitizationConfigTest")
|
||||
}
|
||||
}
|
||||
|
||||
check {
|
||||
dependsOn(testStatementSanitizerConfig)
|
||||
}
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
@ParametersAreNonnullByDefault
|
||||
package io.opentelemetry.instrumentation.api;
|
||||
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
|
@ -1,8 +1,6 @@
|
|||
import net.ltgt.gradle.errorprone.errorprone
|
||||
|
||||
plugins {
|
||||
id("org.xbib.gradle.plugin.jflex")
|
||||
|
||||
id("otel.java-conventions")
|
||||
id("otel.animalsniffer-conventions")
|
||||
id("otel.jacoco-conventions")
|
||||
|
@ -15,7 +13,6 @@ group = "io.opentelemetry.instrumentation"
|
|||
|
||||
dependencies {
|
||||
api("io.opentelemetry:opentelemetry-api")
|
||||
api("io.opentelemetry:opentelemetry-semconv")
|
||||
|
||||
compileOnly("com.google.auto.value:auto-value-annotations")
|
||||
annotationProcessor("com.google.auto.value:auto-value")
|
||||
|
@ -23,6 +20,8 @@ dependencies {
|
|||
testImplementation(project(":testing-common"))
|
||||
testImplementation("io.opentelemetry:opentelemetry-sdk-metrics")
|
||||
testImplementation("io.opentelemetry:opentelemetry-sdk-testing")
|
||||
|
||||
jmhImplementation(project(":instrumentation-api-semconv"))
|
||||
}
|
||||
|
||||
tasks {
|
||||
|
@ -30,35 +29,6 @@ tasks {
|
|||
exclude("**/concurrentlinkedhashmap/**")
|
||||
}
|
||||
|
||||
// Work around https://github.com/jflex-de/jflex/issues/762
|
||||
compileJava {
|
||||
with(options) {
|
||||
compilerArgs.add("-Xlint:-fallthrough")
|
||||
}
|
||||
}
|
||||
|
||||
sourcesJar {
|
||||
dependsOn("generateJflex")
|
||||
}
|
||||
|
||||
val testStatementSanitizerConfig by registering(Test::class) {
|
||||
filter {
|
||||
includeTestsMatching("StatementSanitizationConfigTest")
|
||||
}
|
||||
include("**/StatementSanitizationConfigTest.*")
|
||||
jvmArgs("-Dotel.instrumentation.common.db-statement-sanitizer.enabled=false")
|
||||
}
|
||||
|
||||
test {
|
||||
filter {
|
||||
excludeTestsMatching("StatementSanitizationConfigTest")
|
||||
}
|
||||
}
|
||||
|
||||
check {
|
||||
dependsOn(testStatementSanitizerConfig)
|
||||
}
|
||||
|
||||
// TODO this should live in jmh-conventions
|
||||
named<JavaCompile>("jmhCompileGeneratedClasses") {
|
||||
options.errorprone {
|
||||
|
|
|
@ -8,9 +8,6 @@ package io.opentelemetry.instrumentation.api.instrumenter;
|
|||
import io.opentelemetry.api.common.AttributeKey;
|
||||
import io.opentelemetry.api.common.AttributesBuilder;
|
||||
import io.opentelemetry.context.Context;
|
||||
import io.opentelemetry.instrumentation.api.instrumenter.db.DbClientAttributesExtractor;
|
||||
import io.opentelemetry.instrumentation.api.instrumenter.http.HttpClientAttributesExtractor;
|
||||
import io.opentelemetry.instrumentation.api.instrumenter.net.NetServerAttributesExtractor;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
|
@ -20,10 +17,6 @@ import javax.annotation.Nullable;
|
|||
* Throwable) on end} with both {@link REQUEST} and {@link RESPONSE} to allow populating attributes
|
||||
* at each stage of a request's lifecycle. It is best to populate as much as possible in {@link
|
||||
* #onStart(AttributesBuilder, Context, Object)} to have it available during sampling.
|
||||
*
|
||||
* @see DbClientAttributesExtractor
|
||||
* @see HttpClientAttributesExtractor
|
||||
* @see NetServerAttributesExtractor
|
||||
*/
|
||||
public interface AttributesExtractor<REQUEST, RESPONSE> {
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue