Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ see [Migrate from the SignalFx Java Agent](https://help.splunk.com/en/splunk-obs

<!-- Comments, spacing, empty and new lines in the section below are intentional, please do not modify them! -->
<!--DEV_DOCS_WARNING-->
<!--DEV_DOCS_WARNING_START-->
The following documentation refers to the in-development version of `splunk-otel-java`. Docs for the latest version ([v2.33.0](https://github.com/signalfx/splunk-otel-java/releases/latest)) can be found [here](https://github.com/signalfx/splunk-otel-java/blob/v2.33.0/README.md).

---
<!--DEV_DOCS_WARNING_END-->

## Requirements

Expand Down Expand Up @@ -82,7 +87,7 @@ with:

## Snapshot builds

We publish [snapshot builds](https://central.sonatype.com/service/rest/repository/browse/maven-snapshots/com/splunk/splunk-otel-javaagent/2.33.0-SNAPSHOT/)
We publish [snapshot builds](https://central.sonatype.com/service/rest/repository/browse/maven-snapshots/com/splunk/splunk-otel-javaagent/3.0.0-SNAPSHOT/)
with every merge to the `main` branch. Snapshots are primarily intended to test new functionality and are not recommended
for production use.

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,6 @@ void extract() {
context,
map,
new TextMapGetter<>() {
@Override
public Iterable<String> keys(Map<String, String> carrier) {

@laurit laurit Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the keys method is deprecated and now has a default implementation that returns and empty iterable

return carrier.keySet();
}

@Nullable
@Override
public String get(@Nullable Map<String, String> carrier, String key) {
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion dependencyManagement/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {

val otelVersion = "1.67.0"
val otelAlphaVersion = otelVersion.replaceFirst("(-SNAPSHOT)?$".toRegex(), "-alpha$1")
val otelInstrumentationVersion = "2.33.0"
val otelInstrumentationVersion = "3.0.0-SNAPSHOT"
Comment thread
breedx-splk marked this conversation as resolved.
val otelInstrumentationAlphaVersion = otelInstrumentationVersion.replaceFirst("(-SNAPSHOT)?$".toRegex(), "-alpha$1")
val otelContribAlphaVersion = "1.61.0-alpha"

Expand Down
1 change: 1 addition & 0 deletions deployments/cloudfoundry/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,4 @@
2.30.0: https://github.com/signalfx/splunk-otel-java/releases/download/v2.30.0/splunk-otel-javaagent.jar
2.31.0: https://github.com/signalfx/splunk-otel-java/releases/download/v2.31.0/splunk-otel-javaagent.jar
2.32.0: https://github.com/signalfx/splunk-otel-java/releases/download/v2.32.0/splunk-otel-javaagent.jar
2.33.0: https://github.com/signalfx/splunk-otel-java/releases/download/v2.33.0/splunk-otel-javaagent.jar
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void transform(TypeTransformer typeTransformer) {

@SuppressWarnings("unused")
public static class WebengineInitializedAdvice {
@Advice.OnMethodExit(suppress = Throwable.class)
@Advice.OnMethodExit(suppress = Throwable.class, inline = false)
public static void onExit() {
WebengineHolder.trySetName(Version.getProductName());
WebengineHolder.trySetVersion(Version.getVersionNumber());
Expand Down
1 change: 1 addition & 0 deletions instrumentation/jdbc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ dependencies {

tasks.withType<Test>().configureEach {
systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean)
systemProperty("jdbcTestMode", "true")
jvmArgs("-Dotel.instrumentation.splunk-jdbc.enabled=true")
jvmArgs("-Dotel.service.name=test-service")
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.splunk.opentelemetry.instrumentation.jdbc.mariadb;

import static java.util.Collections.emptyList;
import static java.util.Collections.singletonList;

import com.google.auto.service.AutoService;
Expand Down Expand Up @@ -50,4 +51,17 @@ public List<TypeInstrumentation> typeInstrumentations() {
public boolean isHelperClass(String className) {
return className.startsWith("com.splunk.opentelemetry.instrumentation");
}

@Override
public List<String> exposedClassNames() {
// Statement instrumentation uses MariaDbContextPropagator class with CallDepth to skip
// instrumenting the nested statement that propagates context to db. This class is loaded in the
// isolated instrumentation class loader. We expose it to application class loader so that tests
// can temporarily disable instrumentation with CallDepth to read the curent tracing context
// from the db.
return Boolean.getBoolean("jdbcTestMode")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is needed because of switching to non-inline advice. An alternative is to use reflection in the test to get access to the isolated instrumentation class loader and load the class from there. That approach is used in a couple of upstream tests.

? singletonList(
"com.splunk.opentelemetry.instrumentation.jdbc.mariadb.MariaDbContextPropagator")
: emptyList();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void transform(TypeTransformer transformer) {

@SuppressWarnings("unused")
public static class SetContextAdvice {
@Advice.OnMethodEnter(suppress = Throwable.class)
@Advice.OnMethodEnter(suppress = Throwable.class, inline = false)
public static CallDepth onEnter(@Advice.This Statement statement) throws Exception {
CallDepth callDepth = CallDepth.forClass(MariaDbContextPropagator.class);
if (callDepth.getAndIncrement() == 0) {
Expand All @@ -69,7 +69,7 @@ public static CallDepth onEnter(@Advice.This Statement statement) throws Excepti
return callDepth;
}

@Advice.OnMethodExit(suppress = Throwable.class)
@Advice.OnMethodExit(suppress = Throwable.class, inline = false)
public static void onExit(@Advice.Enter CallDepth callDepth) {
callDepth.decrementAndGet();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.splunk.opentelemetry.instrumentation.jdbc.mysql;

import static java.util.Collections.emptyList;
import static java.util.Collections.singletonList;

import com.google.auto.service.AutoService;
Expand Down Expand Up @@ -50,4 +51,17 @@ public List<TypeInstrumentation> typeInstrumentations() {
public boolean isHelperClass(String className) {
return className.startsWith("com.splunk.opentelemetry.instrumentation");
}

@Override
public List<String> exposedClassNames() {
// Statement instrumentation uses MySqlContextPropagator class with CallDepth to skip
// instrumenting the nested statement that propagates context to db. This class is loaded in the
// isolated instrumentation class loader. We expose it to application class loader so that tests
// can temporarily disable instrumentation with CallDepth to read the curent tracing context
// from the db.
return Boolean.getBoolean("jdbcTestMode")
? singletonList(
"com.splunk.opentelemetry.instrumentation.jdbc.mysql.MySqlContextPropagator")
: emptyList();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void transform(TypeTransformer transformer) {

@SuppressWarnings("unused")
public static class SetContextAdvice {
@Advice.OnMethodEnter(suppress = Throwable.class)
@Advice.OnMethodEnter(suppress = Throwable.class, inline = false)
Comment thread
robsunday marked this conversation as resolved.
public static CallDepth onEnter(@Advice.This Statement statement) throws Exception {
CallDepth callDepth = CallDepth.forClass(MySqlContextPropagator.class);
if (callDepth.getAndIncrement() == 0) {
Expand All @@ -60,7 +60,7 @@ public static CallDepth onEnter(@Advice.This Statement statement) throws Excepti
return callDepth;
}

@Advice.OnMethodExit(suppress = Throwable.class)
@Advice.OnMethodExit(suppress = Throwable.class, inline = false)
public static void onExit(@Advice.Enter CallDepth callDepth) {
callDepth.decrementAndGet();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.splunk.opentelemetry.instrumentation.jdbc.oracle;

import static java.util.Collections.emptyList;
import static java.util.Collections.singletonList;

import com.google.auto.service.AutoService;
Expand Down Expand Up @@ -50,4 +51,17 @@ public List<TypeInstrumentation> typeInstrumentations() {
public boolean isHelperClass(String className) {
return className.startsWith("com.splunk.opentelemetry.instrumentation");
}

@Override
public List<String> exposedClassNames() {
// Statement instrumentation uses OracleContextPropagator class with CallDepth to skip
// instrumenting the nested statement that propagates context to db. This class is loaded in the
// isolated instrumentation class loader. We expose it to application class loader so that tests
// can temporarily disable instrumentation with CallDepth to read the curent tracing context
// from the db.
return Boolean.getBoolean("jdbcTestMode")
? singletonList(
"com.splunk.opentelemetry.instrumentation.jdbc.oracle.OracleContextPropagator")
: emptyList();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void transform(TypeTransformer transformer) {

@SuppressWarnings("unused")
public static class SetActionAdvice {
@Advice.OnMethodEnter(suppress = Throwable.class)
@Advice.OnMethodEnter(suppress = Throwable.class, inline = false)
public static CallDepth onEnter(@Advice.This Statement statement) throws Exception {
CallDepth callDepth = CallDepth.forClass(OracleContextPropagator.class);
if (callDepth.getAndIncrement() == 0) {
Expand All @@ -61,7 +61,7 @@ public static CallDepth onEnter(@Advice.This Statement statement) throws Excepti
return callDepth;
}

@Advice.OnMethodExit(suppress = Throwable.class)
@Advice.OnMethodExit(suppress = Throwable.class, inline = false)
public static void onExit(@Advice.Enter CallDepth callDepth) {
callDepth.decrementAndGet();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.splunk.opentelemetry.instrumentation.jdbc.postgresql;

import static java.util.Collections.emptyList;
import static java.util.Collections.singletonList;

import com.google.auto.service.AutoService;
Expand Down Expand Up @@ -50,4 +51,17 @@ public List<TypeInstrumentation> typeInstrumentations() {
public boolean isHelperClass(String className) {
return className.startsWith("com.splunk.opentelemetry.instrumentation");
}

@Override
public List<String> exposedClassNames() {
// Statement instrumentation uses PostgreSqlContextPropagator class with CallDepth to skip
// instrumenting the nested statement that propagates context to db. This class is loaded in the
// isolated instrumentation class loader. We expose it to application class loader so that tests
// can temporarily disable instrumentation with CallDepth to read the curent tracing context
// from the db.
return Boolean.getBoolean("jdbcTestMode")
? singletonList(
"com.splunk.opentelemetry.instrumentation.jdbc.postgresql.PostgreSqlContextPropagator")
: emptyList();
}
}
Loading
Loading