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: 7 additions & 0 deletions custom/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ dependencies {
// exclude transitive dependency as it's provided through agent packaging
exclude(group = "io.opentelemetry", module = "opentelemetry-sdk")
}
implementation(libs.contribInferredSpans) {
// exclude transitive dependency as it's provided through agent packaging
exclude(group = "io.opentelemetry", module = "opentelemetry-sdk")
exclude(group = "io.opentelemetry", module = "opentelemetry-semconv")
exclude(group = "io.opentelemetry", module = "opentelemetry-sdk-extension-autoconfigure-spi")
}

testImplementation(libs.contribSpanStacktrace)

// needs to be added in order to allow access to AgentListener interface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import co.elastic.otel.compositesampling.DynamicCompositeParentBasedTraceIdRatioBasedSampler;
import co.elastic.otel.dynamicconfig.internal.OpampManager;
import co.elastic.otel.logging.AgentLog;
import io.opentelemetry.contrib.inferredspans.InferredSpans;
import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties;
import io.opentelemetry.sdk.trace.SdkTracerProviderBuilder;
import java.io.IOException;
Expand Down Expand Up @@ -130,6 +131,7 @@ public static class Configs {
new DeactivateInstrumentations(),
new LoggingLevel(),
new SamplingRate(),
new InferSpans(),
new PollingInterval())
.collect(Collectors.toMap(ConfigOption::getConfigName, option -> option));
}
Expand Down Expand Up @@ -314,6 +316,22 @@ void update(String configurationValue, OpampManager opampManager)
}
}

public static final class InferSpans extends ConfigOption {
InferSpans() {
super("infer_spans", "true");
}

@Override
void update(String configurationValue, OpampManager opampManager)
throws IllegalArgumentException {
// TODO when setProfilerInterval() returns the old value, use that for 'true'
Copy link
Member

Choose a reason for hiding this comment

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

Can we deal with this directly in this PR or are we blocked on open-telemetry/opentelemetry-java-contrib#2354 to be included in a release ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

waiting for that so at least a month away

InferredSpans.setProfilerInterval(
configurationValue.equals("true")
? Duration.ofSeconds(5)
: Duration.ofSeconds(Integer.MAX_VALUE));
}
}

public static final class PollingInterval extends ConfigOption {
PollingInterval() {
super("opamp_polling_interval", "30s");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
import com.dslplatform.json.DslJson;
import com.dslplatform.json.JsonReader;
import com.dslplatform.json.MapConverter;
import io.opentelemetry.opamp.client.internal.OpampClient;
import io.opentelemetry.opamp.client.internal.OpampClientBuilder;
import io.opentelemetry.opamp.client.OpampClient;
import io.opentelemetry.opamp.client.OpampClientBuilder;
import io.opentelemetry.opamp.client.internal.connectivity.http.OkHttpSender;
import io.opentelemetry.opamp.client.internal.request.delay.PeriodicDelay;
import io.opentelemetry.opamp.client.internal.request.delay.RetryPeriodicDelay;
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ opentelemetryJavaagentAlpha = "2.20.1-alpha"

# otel contrib
# updated from upstream agent with gradle/update-upstream.sh
opentelemetryContribAlpha = "1.49.0-alpha"
opentelemetryContribAlpha = "1.50.0-alpha"

# otel semconv
# updated from upstream agent with gradle/update-upstream.sh
Expand Down
Loading