Skip to content

Commit

Permalink
Use new semconv artifact (#1423)
Browse files Browse the repository at this point in the history
* Use new semconv artifact

* generateLicenseReport
  • Loading branch information
Mateusz Rzeszutek authored Sep 14, 2023
1 parent 7541dc4 commit dc9369f
Show file tree
Hide file tree
Showing 16 changed files with 39 additions and 41 deletions.
2 changes: 1 addition & 1 deletion agent/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ tasks {
exclude(dependency("io.opentelemetry:opentelemetry-api-events"))
exclude(dependency("io.opentelemetry:opentelemetry-api-logs"))
exclude(dependency("io.opentelemetry:opentelemetry-context"))
exclude(dependency("io.opentelemetry:opentelemetry-semconv"))
exclude(dependency("io.opentelemetry.semconv:opentelemetry-semconv"))
// metrics advice API
exclude(dependency("io.opentelemetry:opentelemetry-extension-incubator"))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dependencies {
compileOnly("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api")
compileOnly("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-semconv")
compileOnly("io.opentelemetry.javaagent:opentelemetry-javaagent-extension-api")
compileOnly("io.opentelemetry.semconv:opentelemetry-semconv")
annotationProcessor("com.google.auto.service:auto-service")
compileOnly("com.google.auto.service:auto-service")
compileOnly(project(":bootstrap"))
Expand Down
3 changes: 2 additions & 1 deletion custom/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ dependencies {
compileOnly("io.opentelemetry:opentelemetry-sdk")
compileOnly("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure")
compileOnly("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure-spi")
compileOnly("io.opentelemetry:opentelemetry-semconv")
compileOnly("io.opentelemetry.semconv:opentelemetry-semconv")
compileOnly("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api")
compileOnly("io.opentelemetry.javaagent:opentelemetry-javaagent-extension-api")
compileOnly("io.opentelemetry.javaagent:opentelemetry-javaagent-tooling")
Expand Down Expand Up @@ -32,6 +32,7 @@ dependencies {
testImplementation("io.opentelemetry:opentelemetry-sdk-testing")
testImplementation("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure")
testImplementation("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure-spi")
testImplementation("io.opentelemetry.semconv:opentelemetry-semconv")
testImplementation("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api")
testImplementation("io.opentelemetry.javaagent:opentelemetry-javaagent-extension-api")
testImplementation("io.opentelemetry.javaagent:opentelemetry-javaagent-tooling")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@
import static java.util.logging.Level.WARNING;

import com.google.auto.service.AutoService;
import io.opentelemetry.api.common.AttributeKey;
import io.opentelemetry.api.trace.SpanKind;
import io.opentelemetry.contrib.sampler.RuleBasedRoutingSampler;
import io.opentelemetry.contrib.sampler.RuleBasedRoutingSamplerBuilder;
import io.opentelemetry.instrumentation.api.internal.SemconvStability;
import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties;
import io.opentelemetry.sdk.autoconfigure.spi.traces.ConfigurableSamplerProvider;
import io.opentelemetry.sdk.trace.samplers.Sampler;
import io.opentelemetry.semconv.trace.attributes.SemanticAttributes;
import io.opentelemetry.semconv.SemanticAttributes;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;
Expand All @@ -45,11 +47,18 @@ public Sampler createSampler(ConfigProperties config) {

RuleBasedRoutingSamplerBuilder builder =
RuleBasedRoutingSampler.builder(SpanKind.SERVER, samplerConfiguration.fallback);
samplerConfiguration.drop.forEach(d -> builder.drop(SemanticAttributes.HTTP_TARGET, d));
samplerConfiguration.drop.forEach(d -> builder.drop(getHttpPathAttribute(), d));

return builder.build();
}

@SuppressWarnings("deprecation") // old semconv still used
private AttributeKey<String> getHttpPathAttribute() {
return SemconvStability.emitOldHttpSemconv()
? SemanticAttributes.HTTP_TARGET
: SemanticAttributes.URL_PATH;
}

@Override
public String getName() {
return "rules";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import io.opentelemetry.sdk.autoconfigure.spi.AutoConfigurationCustomizerProvider;
import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties;
import io.opentelemetry.sdk.resources.Resource;
import io.opentelemetry.semconv.resource.attributes.ResourceAttributes;
import io.opentelemetry.semconv.ResourceAttributes;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@

package com.splunk.opentelemetry.micrometer;

import static io.opentelemetry.semconv.resource.attributes.ResourceAttributes.CONTAINER_ID;
import static io.opentelemetry.semconv.resource.attributes.ResourceAttributes.DEPLOYMENT_ENVIRONMENT;
import static io.opentelemetry.semconv.resource.attributes.ResourceAttributes.HOST_NAME;
import static io.opentelemetry.semconv.resource.attributes.ResourceAttributes.PROCESS_PID;
import static io.opentelemetry.semconv.resource.attributes.ResourceAttributes.PROCESS_RUNTIME_NAME;
import static io.opentelemetry.semconv.resource.attributes.ResourceAttributes.SERVICE_NAME;
import static io.opentelemetry.semconv.ResourceAttributes.CONTAINER_ID;
import static io.opentelemetry.semconv.ResourceAttributes.DEPLOYMENT_ENVIRONMENT;
import static io.opentelemetry.semconv.ResourceAttributes.HOST_NAME;
import static io.opentelemetry.semconv.ResourceAttributes.PROCESS_PID;
import static io.opentelemetry.semconv.ResourceAttributes.PROCESS_RUNTIME_NAME;
import static io.opentelemetry.semconv.ResourceAttributes.SERVICE_NAME;

import io.micrometer.core.instrument.Tag;
import io.micrometer.core.instrument.Tags;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import io.micrometer.signalfx.SignalFxConfig;
import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties;
import io.opentelemetry.sdk.resources.Resource;
import io.opentelemetry.semconv.resource.attributes.ResourceAttributes;
import io.opentelemetry.semconv.ResourceAttributes;
import java.time.Duration;

class SplunkMetricsConfig implements SignalFxConfig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdk;
import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties;
import io.opentelemetry.sdk.resources.Resource;
import io.opentelemetry.semconv.resource.attributes.ResourceAttributes;
import io.opentelemetry.semconv.ResourceAttributes;
import java.util.Map;
import java.util.function.Consumer;
import java.util.logging.Logger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
import static com.splunk.opentelemetry.SplunkConfiguration.METRICS_ENABLED_PROPERTY;
import static com.splunk.opentelemetry.SplunkConfiguration.METRICS_FULL_COMMAND_LINE;
import static io.opentelemetry.api.common.AttributeKey.stringKey;
import static io.opentelemetry.semconv.resource.attributes.ResourceAttributes.PROCESS_COMMAND_ARGS;
import static io.opentelemetry.semconv.resource.attributes.ResourceAttributes.PROCESS_COMMAND_LINE;
import static io.opentelemetry.semconv.ResourceAttributes.PROCESS_COMMAND_ARGS;
import static io.opentelemetry.semconv.ResourceAttributes.PROCESS_COMMAND_LINE;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertSame;
import static org.mockito.Mockito.mock;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import io.opentelemetry.api.common.AttributeKey;
import io.opentelemetry.api.common.Attributes;
import io.opentelemetry.sdk.resources.Resource;
import io.opentelemetry.semconv.resource.attributes.ResourceAttributes;
import io.opentelemetry.semconv.ResourceAttributes;
import org.junit.jupiter.api.Test;

class GlobalTagsBuilderTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import io.opentelemetry.api.common.Attributes;
import io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdk;
import io.opentelemetry.sdk.resources.Resource;
import io.opentelemetry.semconv.resource.attributes.ResourceAttributes;
import io.opentelemetry.semconv.ResourceAttributes;
import java.time.Duration;
import java.util.Map;
import org.junit.jupiter.api.Test;
Expand Down
21 changes: 2 additions & 19 deletions dependencyManagement/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ dependencies {
api(enforcedPlatform("io.grpc:grpc-bom:1.58.0"))
api(platform("io.micrometer:micrometer-bom:$micrometerVersion"))
api(enforcedPlatform("io.opentelemetry:opentelemetry-bom-alpha:$otelAlphaVersion"))
api(enforcedPlatform("io.opentelemetry:opentelemetry-bom:$otelVersion"))
api(enforcedPlatform("io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom-alpha:$otelInstrumentationAlphaVersion"))
api(enforcedPlatform("org.junit:junit-bom:5.10.0"))
api(enforcedPlatform("org.testcontainers:testcontainers-bom:1.19.0"))

Expand All @@ -56,27 +56,10 @@ dependencies {
api("com.google.auto.value:auto-value:$autoValueVersion")
api("com.google.auto.value:auto-value-annotations:$autoValueVersion")

// otel-java-instrumentation
api("io.opentelemetry.javaagent:opentelemetry-javaagent:$otelInstrumentationVersion")
api("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api:$otelInstrumentationVersion")
api("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-semconv:$otelInstrumentationAlphaVersion")

api("io.opentelemetry.javaagent:opentelemetry-agent-for-testing:$otelInstrumentationAlphaVersion")
api("io.opentelemetry.javaagent:opentelemetry-javaagent-bootstrap:$otelInstrumentationAlphaVersion")
api("io.opentelemetry.javaagent:opentelemetry-javaagent-extension-api:$otelInstrumentationAlphaVersion")
api("io.opentelemetry.javaagent:opentelemetry-javaagent-instrumentation-api:$otelInstrumentationAlphaVersion")
api("io.opentelemetry.javaagent:opentelemetry-javaagent-internal-logging-simple:$otelInstrumentationAlphaVersion")
api("io.opentelemetry.javaagent:opentelemetry-javaagent-tooling:$otelInstrumentationAlphaVersion")
api("io.opentelemetry.javaagent:opentelemetry-muzzle:$otelInstrumentationAlphaVersion")
api("io.opentelemetry.javaagent:opentelemetry-testing-common:$otelInstrumentationAlphaVersion")
api("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-servlet-2.2:$otelInstrumentationAlphaVersion")
api("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-servlet-3.0:$otelInstrumentationAlphaVersion")
api("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-servlet-common:$otelInstrumentationAlphaVersion")

api("io.opentelemetry.contrib:opentelemetry-samplers:$otelContribAlphaVersion")
api("io.opentelemetry.contrib:opentelemetry-resource-providers:$otelContribAlphaVersion")

api("io.opentelemetry.proto:opentelemetry-proto:1.0.0-alpha")
api("io.opentelemetry.semconv:opentelemetry-semconv:1.21.0-alpha")
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import static java.util.Collections.singletonList;

import io.opentelemetry.instrumentation.api.instrumenter.http.HttpClientAttributesGetter;
import io.opentelemetry.semconv.trace.attributes.SemanticAttributes;
import io.opentelemetry.semconv.SemanticAttributes;
import java.net.InetSocketAddress;
import java.util.List;
import java.util.Map;
Expand Down
6 changes: 5 additions & 1 deletion licenses/licenses.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# splunk-otel-javaagent
## Dependency License Report
_2023-09-12 20:46:57 EEST_
_2023-09-14 16:53:56 CEST_
## Apache License, Version 2.0

**1** **Group:** `com.fasterxml.jackson.core` **Name:** `jackson-core` **Version:** `2.15.2`
Expand Down Expand Up @@ -274,4 +274,8 @@ _2023-09-12 20:46:57 EEST_
> - **POM License**: Universal Permissive License Version 1.0 or The 3-Clause BSD License - [https://github.com/openjdk/jmc/blob/master/core/license/LICENSE.txt](https://github.com/openjdk/jmc/blob/master/core/license/LICENSE.txt)
> - **Embedded license files**: [flightrecorder-8.3.1.jar/LICENSE.txt](flightrecorder-8.3.1.jar/LICENSE.txt)
## Unknown

**54** **Group:** `io.opentelemetry.instrumentation` **Name:** `opentelemetry-instrumentation-bom-alpha` **Version:** `1.30.0-alpha-SNAPSHOT`


4 changes: 2 additions & 2 deletions profiler/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ dependencies {
compileOnly("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure-spi")
compileOnly("io.opentelemetry.javaagent:opentelemetry-javaagent-extension-api")
compileOnly("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api")
compileOnly("io.opentelemetry:opentelemetry-semconv")
compileOnly("io.opentelemetry.semconv:opentelemetry-semconv")
// required to access InstrumentationHolder
compileOnly("io.opentelemetry.javaagent:opentelemetry-javaagent-bootstrap")
implementation("io.opentelemetry:opentelemetry-sdk-logs")
Expand All @@ -42,7 +42,7 @@ dependencies {
testImplementation("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api")
testImplementation("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure")
testImplementation("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure-spi")
testImplementation("io.opentelemetry:opentelemetry-semconv")
testImplementation("io.opentelemetry.semconv:opentelemetry-semconv")
testImplementation("io.opentelemetry:opentelemetry-context")
testImplementation("io.opentelemetry:opentelemetry-api")
testImplementation("io.opentelemetry:opentelemetry-sdk")
Expand Down
2 changes: 1 addition & 1 deletion testing/agent-for-testing/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ tasks {
exclude(dependency("io.opentelemetry:opentelemetry-api-events"))
exclude(dependency("io.opentelemetry:opentelemetry-api-logs"))
exclude(dependency("io.opentelemetry:opentelemetry-context"))
exclude(dependency("io.opentelemetry:opentelemetry-semconv"))
exclude(dependency("io.opentelemetry.semconv:opentelemetry-semconv"))
// metrics advice API
exclude(dependency("io.opentelemetry:opentelemetry-extension-incubator"))
}
Expand Down

0 comments on commit dc9369f

Please sign in to comment.