Skip to content

Commit

Permalink
Merge branch 'main' into issue-9047
Browse files Browse the repository at this point in the history
  • Loading branch information
mmorel-35 authored Oct 12, 2023
2 parents 8424036 + 57e6be4 commit b73017f
Show file tree
Hide file tree
Showing 233 changed files with 6,828 additions and 2,734 deletions.
8 changes: 8 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@
"matchPackagePrefixes": ["com.linecorp.armeria:"],
"groupName": "armeria packages"
},
{
"matchPackagePrefixes": ["com.diffplug.spotless"],
"groupName": "spotless packages"
},
{
"matchPackagePrefixes": ["net.bytebuddy:"],
"groupName": "byte buddy packages"
},
{
// prevent update to 2.4-groovy-4.0-SNAPSHOT
"matchPackageNames": ["org.spockframework:spock-bom"],
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ jobs:
- 8
- 11
- 17
- 20
- 21
vm:
- hotspot
- openj9
Expand All @@ -197,7 +197,7 @@ jobs:
- 3
exclude:
- vm: ${{ inputs.skip-openj9-tests && 'openj9' || '' }}
- test-java-version: 20
- test-java-version: 21
vm: openj9
fail-fast: false
steps:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/reusable-markdown-link-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ jobs:
-name '*.md' \
-not -path './CHANGELOG.md' \
-not -path './licenses/*' \
-not -path '*/build/*' \
| xargs .github/scripts/markdown-link-check-with-retry.sh
4 changes: 2 additions & 2 deletions benchmark-overhead/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ repositories {
dependencies {
implementation(enforcedPlatform("org.junit:junit-bom:5.10.0"))

testImplementation("org.testcontainers:testcontainers:1.19.0")
testImplementation("org.testcontainers:postgresql:1.19.0")
testImplementation("org.testcontainers:testcontainers:1.19.1")
testImplementation("org.testcontainers:postgresql:1.19.1")
testImplementation("org.junit.jupiter:junit-jupiter-api")
testImplementation("org.junit.jupiter:junit-jupiter-params")
testImplementation("com.squareup.okhttp3:okhttp:4.11.0")
Expand Down
4 changes: 2 additions & 2 deletions benchmark-overhead/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=591855b517fc635b9e04de1d05d5e76ada3f89f5fc76f87978d1b245b4f69225
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
distributionSha256Sum=3e1af3ae886920c3ac87f7a91f816c0c7c436f276a6eefdb3da152100fef72ae
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
14 changes: 7 additions & 7 deletions benchmark-overhead/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -202,11 +202,11 @@ fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down
6 changes: 3 additions & 3 deletions conventions/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ dependencies {

// When updating, update above in plugins too
implementation("com.diffplug.spotless:spotless-plugin-gradle:6.22.0")
implementation("com.google.guava:guava:32.1.2-jre")
implementation("com.google.guava:guava:32.1.3-jre")
implementation("gradle.plugin.com.google.protobuf:protobuf-gradle-plugin:0.8.18")
implementation("com.github.johnrengelman:shadow:8.1.1")
implementation("org.apache.httpcomponents:httpclient:4.5.14")
implementation("com.gradle.enterprise:com.gradle.enterprise.gradle.plugin:3.15")
implementation("com.gradle.enterprise:com.gradle.enterprise.gradle.plugin:3.15.1")
implementation("org.owasp:dependency-check-gradle:8.4.0")
implementation("ru.vyarus:gradle-animalsniffer-plugin:1.7.1")
// When updating, also update dependencyManagement/build.gradle.kts
implementation("net.bytebuddy:byte-buddy-gradle-plugin:1.14.8")
implementation("net.bytebuddy:byte-buddy-gradle-plugin:1.14.9")
implementation("gradle.plugin.io.morethan.jmhreport:gradle-jmh-report:0.9.0")
implementation("me.champeau.jmh:jmh-gradle-plugin:0.7.1")
implementation("net.ltgt.gradle:gradle-errorprone-plugin:3.1.0")
Expand Down
43 changes: 39 additions & 4 deletions conventions/src/main/kotlin/otel.java-conventions.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ abstract class NettyAlignmentRule : ComponentMetadataRule {
with(ctx.details) {
if (id.group == "io.netty" && id.name != "netty") {
if (id.version.startsWith("4.1.")) {
// netty 4.1.98 does not run correctly on MacOS
belongsTo("io.netty:netty-bom:4.1.99.Final", false)
belongsTo("io.netty:netty-bom:4.1.100.Final", false)
} else if (id.version.startsWith("4.0.")) {
belongsTo("io.netty:netty-bom:4.0.56.Final", false)
}
Expand Down Expand Up @@ -195,6 +194,41 @@ testing {
}
}

var path = project.path
if (path.startsWith(":instrumentation:")) {
// remove segments that are a prefix of the next segment
// for example :instrumentation:log4j:log4j-context-data:log4j-context-data-2.17 is transformed to log4j-context-data-2.17
var tmpPath = path
val suffix = tmpPath.substringAfterLast(':')
var prefix = ":instrumentation:"
if (suffix == "library") {
// strip ":library" suffix
tmpPath = tmpPath.substringBeforeLast(':')
} else if (suffix == "library-autoconfigure") {
// replace ":library-autoconfigure" with "-autoconfigure"
tmpPath = tmpPath.substringBeforeLast(':') + "-autoconfigure"
} else if (suffix == "javaagent") {
// strip ":javaagent" suffix and add it to prefix
prefix += "javaagent:"
tmpPath = tmpPath.substringBeforeLast(':')
}
val segments = tmpPath.substring(":instrumentation:".length).split(':')
var newPath = ""
var done = false
for (s in segments) {
if (!done && (newPath.isEmpty() || s.startsWith(newPath))) {
newPath = s
} else {
newPath += ":$s"
done = true
}
}
if (newPath.isNotEmpty()) {
path = prefix + newPath
}
}
var javaModuleName = "io.opentelemetry" + path.replace(".", "_").replace("-", "_").replace(":", ".")

tasks {
named<Jar>("jar") {
// By default Gradle Jar task can put multiple files with the same name
Expand All @@ -211,7 +245,8 @@ tasks {
"Implementation-Title" to project.name,
"Implementation-Version" to project.version,
"Implementation-Vendor" to "OpenTelemetry",
"Implementation-URL" to "https://github.com/open-telemetry/opentelemetry-java-instrumentation"
"Implementation-URL" to "https://github.com/open-telemetry/opentelemetry-java-instrumentation",
"Automatic-Module-Name" to javaModuleName
)
}
}
Expand Down Expand Up @@ -367,7 +402,7 @@ codenarc {
checkstyle {
configFile = rootProject.file("buildscripts/checkstyle.xml")
// this version should match the version of google_checks.xml used as basis for above configuration
toolVersion = "10.12.3"
toolVersion = "10.12.4"
maxWarnings = 0
}

Expand Down
14 changes: 7 additions & 7 deletions dependencyManagement/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ val dependencyVersions = hashMapOf<String, String>()
rootProject.extra["versions"] = dependencyVersions

// this line is managed by .github/scripts/update-sdk-version.sh
val otelSdkVersion = "1.30.1"
val otelSdkVersion = "1.31.0"
val otelSdkAlphaVersion = otelSdkVersion.replaceFirst("(-SNAPSHOT)?$".toRegex(), "-alpha$1")

// Need both BOM and groovy jars
Expand All @@ -27,21 +27,21 @@ val groovyVersion = "4.0.15"

val DEPENDENCY_BOMS = listOf(
"com.fasterxml.jackson:jackson-bom:2.15.2",
"com.squareup.okio:okio-bom:3.5.0", // see https://github.com/open-telemetry/opentelemetry-java/issues/5637
"com.google.guava:guava-bom:32.1.2-jre",
"com.squareup.okio:okio-bom:3.6.0", // see https://github.com/open-telemetry/opentelemetry-java/issues/5637
"com.google.guava:guava-bom:32.1.3-jre",
"org.apache.groovy:groovy-bom:${groovyVersion}",
"io.opentelemetry:opentelemetry-bom:${otelSdkVersion}",
"io.opentelemetry:opentelemetry-bom-alpha:${otelSdkAlphaVersion}",
"org.junit:junit-bom:5.10.0",
"org.testcontainers:testcontainers-bom:1.19.0",
"org.testcontainers:testcontainers-bom:1.19.1",
"org.spockframework:spock-bom:2.4-M1-groovy-4.0"
)

val autoServiceVersion = "1.1.1"
val autoValueVersion = "1.10.4"
val errorProneVersion = "2.22.0"
val byteBuddyVersion = "1.14.8"
val asmVersion = "9.5"
val byteBuddyVersion = "1.14.9"
val asmVersion = "9.6"
val jmhVersion = "1.37"
val mockitoVersion = "4.11.0"
val slf4jVersion = "2.0.9"
Expand Down Expand Up @@ -91,7 +91,7 @@ val DEPENDENCIES = listOf(
"commons-collections:commons-collections:3.2.2",
"commons-digester:commons-digester:2.1",
"commons-fileupload:commons-fileupload:1.5",
"commons-io:commons-io:2.13.0",
"commons-io:commons-io:2.14.0",
"commons-lang:commons-lang:2.6",
"commons-logging:commons-logging:1.2",
"commons-validator:commons-validator:1.7",
Expand Down
4 changes: 2 additions & 2 deletions docs/contributing/using-instrumenter-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ A `SpanNameExtractor` is a simple functional interface that accepts the `REQUEST
the span name. For more detailed guidelines on span naming please take a look at
the [`Span` specification](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#span)
and the
tracing [semantic conventions](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/README.md).
tracing [semantic conventions](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/general/trace.md).

Consider the following example:

Expand Down Expand Up @@ -453,6 +453,6 @@ class MySpanKindExtractor implements SpanKindExtractor<Request> {
The example `SpanKindExtractor` above decides whether to use `PRODUCER` or `CLIENT` based on how the
request is going to be processed. This example reflects a real-life scenario: you might find
similar code in a messaging library instrumentation, since according to
the [OpenTelemetry messaging semantic conventions](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/messaging.md#span-kind)
the [OpenTelemetry messaging semantic conventions](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/messaging/messaging-spans.md#span-kind)
the span kind should be set to `CLIENT` if sending the message is completely synchronous and waits
for the response.
4 changes: 2 additions & 2 deletions docs/supported-libraries.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ These are the supported libraries and frameworks:
| [JDBC](https://docs.oracle.com/javase/8/docs/api/java/sql/package-summary.html) | Java 8+ | [opentelemetry-jdbc](../instrumentation/jdbc/library) | [Database Client Spans] |
| [Jedis](https://github.com/xetorthio/jedis) | 1.4+ | N/A | [Database Client Spans] |
| [JMS](https://javaee.github.io/javaee-spec/javadocs/javax/jms/package-summary.html) | 1.1+ | N/A | [Messaging Spans] |
| [Jodd Http](https://javadoc.io/doc/org.jodd/jodd-http/latest/index.html) | 4.2+ | N/A | [HTTP Client Spans], [HTTP Client Metrics] |
| [Jodd Http](https://http.jodd.org/) | 4.2+ | N/A | [HTTP Client Spans], [HTTP Client Metrics] |
| [JSP](https://javaee.github.io/javaee-spec/javadocs/javax/servlet/jsp/package-summary.html) | 2.3+ | N/A | none |
| [Kotlin Coroutines](https://kotlinlang.org/docs/coroutines-overview.html) | 1.0+ | N/A | Context propagation |
| [Ktor](https://github.com/ktorio/ktor) | 1.0+ | [opentelemetry-ktor-1.0](../instrumentation/ktor/ktor-1.0/library),<br>[opentelemetry-ktor-2.0](../instrumentation/ktor/ktor-2.0/library) | [HTTP Client Spans], [HTTP Client Metrics], [HTTP Server Spans], [HTTP Server Metrics] |
Expand Down Expand Up @@ -155,7 +155,7 @@ These are the supported libraries and frameworks:
[Messaging Spans]: https://github.com/open-telemetry/semantic-conventions/blob/main/docs/messaging/messaging-spans.md
[Database Client Spans]: https://github.com/open-telemetry/semantic-conventions/blob/main/docs/database/database-spans.md
[Database Pool Metrics]: https://github.com/open-telemetry/semantic-conventions/blob/main/docs/database/database-metrics.md
[JVM Runtime Metrics]: https://github.com/open-telemetry/semantic-conventions/blob/main/docs/system/runtime-environment-metrics.md#jvm-metrics
[JVM Runtime Metrics]: https://github.com/open-telemetry/semantic-conventions/blob/main/docs/runtime/jvm-metrics.md
[System Metrics]: https://github.com/open-telemetry/semantic-conventions/blob/main/docs/system/system-metrics.md
[GraphQL Server Spans]: https://github.com/open-telemetry/semantic-conventions/blob/main/docs/database/graphql.md
[FaaS Server Spans]: https://github.com/open-telemetry/semantic-conventions/blob/main/docs/faas/faas-spans.md
Expand Down
1 change: 0 additions & 1 deletion examples/distro/agent/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ tasks {
exclude("io.opentelemetry:opentelemetry-api")
exclude("io.opentelemetry:opentelemetry-api-events")
exclude("io.opentelemetry:opentelemetry-context")
exclude("io.opentelemetry:opentelemetry-semconv")
// metrics advice API
exclude("io.opentelemetry:opentelemetry-extension-incubator")
}
Expand Down
4 changes: 2 additions & 2 deletions examples/distro/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ subprojects {
ext {
versions = [
// this line is managed by .github/scripts/update-sdk-version.sh
opentelemetrySdk : "1.30.1",
opentelemetrySdk : "1.31.0",

// these lines are managed by .github/scripts/update-version.sh
opentelemetryJavaagent : "1.31.0-SNAPSHOT",
Expand Down Expand Up @@ -68,7 +68,7 @@ subprojects {
implementation(platform("io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom:${versions.opentelemetryJavaagent}"))
implementation(platform("io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom-alpha:${versions.opentelemetryJavaagentAlpha}"))

testImplementation("org.mockito:mockito-core:5.5.0")
testImplementation("org.mockito:mockito-core:5.6.0")
testImplementation(enforcedPlatform("org.junit:junit-bom:${versions.junit}"))
testImplementation("org.junit.jupiter:junit-jupiter-api:${versions.junit}")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${versions.junit}")
Expand Down
4 changes: 2 additions & 2 deletions examples/distro/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=591855b517fc635b9e04de1d05d5e76ada3f89f5fc76f87978d1b245b4f69225
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
distributionSha256Sum=3e1af3ae886920c3ac87f7a91f816c0c7c436f276a6eefdb3da152100fef72ae
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Loading

0 comments on commit b73017f

Please sign in to comment.