Skip to content

Commit

Permalink
chore: bumped otel version to 2.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianEstrada committed Nov 23, 2024
1 parent 888fc2f commit 8da12e5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
6 changes: 2 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
val kotlinVersion: String by project

plugins {
kotlin("jvm") version "2.0.21"
id("com.github.johnrengelman.shadow") version "8.1.1"
Expand All @@ -15,11 +13,11 @@ repositories {
}

dependencies {
val otelVersion = "2.6.0"
val otelVersion = "2.10.0"
implementation(platform("io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom-alpha:$otelVersion-alpha"))
implementation("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure")
implementation("io.opentelemetry.semconv:opentelemetry-semconv")
implementation("io.opentelemetry.contrib:opentelemetry-samplers:1.37.0-alpha")
implementation("io.opentelemetry.contrib:opentelemetry-samplers:1.41.0-alpha")
}

sourceSets {
Expand Down
1 change: 0 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
kotlinVersion=1.8.22
org.gradle.jvmargs=-Xmx4096m
org.gradle.warning.mode=all
13 changes: 7 additions & 6 deletions src/main/kotlin/com/monta/otel/extension/Customizer.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
import io.opentelemetry.sdk.resources.Resource;
import io.opentelemetry.sdk.trace.samplers.Sampler;
import io.opentelemetry.semconv.ResourceAttributes;
import io.opentelemetry.semconv.SemanticAttributes;
import io.opentelemetry.semconv.ServiceAttributes;
import io.opentelemetry.semconv.UrlAttributes;

import java.util.UUID;

Expand All @@ -25,9 +26,9 @@ public void customize(AutoConfigurationCustomizer autoConfiguration) {
resource.merge(
Resource.builder()
.put(ResourceAttributes.SERVICE_INSTANCE_ID, UUID.randomUUID().toString())
.put(ResourceAttributes.SERVICE_NAME, System.getenv("SERVICE_NAME"))
.put(ServiceAttributes.SERVICE_NAME, System.getenv("SERVICE_NAME"))
.put(ResourceAttributes.DEPLOYMENT_ENVIRONMENT, System.getenv("STAGE"))
.put(ResourceAttributes.SERVICE_VERSION, System.getenv("BUILD_NUMBER"))
.put(ServiceAttributes.SERVICE_VERSION, System.getenv("BUILD_NUMBER"))
.build()
)
);
Expand All @@ -38,9 +39,9 @@ public void customize(AutoConfigurationCustomizer autoConfiguration) {
sdkTracerProviderBuilder.setSampler(
Sampler.parentBased(
RuleBasedRoutingSampler.builder(SpanKind.SERVER, getSampler())
.drop(SemanticAttributes.URL_PATH, "/health*")
.drop(SemanticAttributes.URL_PATH, "/prometheus*")
.drop(SemanticAttributes.URL_PATH, "/metrics*")
.drop(UrlAttributes.URL_PATH, "/health*")
.drop(UrlAttributes.URL_PATH, "/prometheus*")
.drop(UrlAttributes.URL_PATH, "/metrics*")
.build()
)
)
Expand Down

0 comments on commit 8da12e5

Please sign in to comment.