From 101f4ab66e9fa6fdf886712bb3aea035e2173050 Mon Sep 17 00:00:00 2001 From: Phillip Carter Date: Sat, 20 Apr 2024 08:09:21 -0700 Subject: [PATCH 1/4] Add missing FQN for common resource attributes fixes https://github.com/open-telemetry/opentelemetry.io/issues/4328 --- content/en/docs/languages/java/exporters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/docs/languages/java/exporters.md b/content/en/docs/languages/java/exporters.md index 624c3ce1c352..30f32256ac35 100644 --- a/content/en/docs/languages/java/exporters.md +++ b/content/en/docs/languages/java/exporters.md @@ -131,7 +131,7 @@ public class DiceApplication { @Bean public OpenTelemetry openTelemetry() { - Resource resource = Resource.getDefault().toBuilder().put(SERVICE_NAME, "dice-server").put(SERVICE_VERSION, "0.1.0").build(); + Resource resource = Resource.getDefault().toBuilder().put(ResourceAttributes.SERVICE_NAME, "dice-server").put(ResourceAttributes.SERVICE_VERSION, "0.1.0").build(); SdkTracerProvider sdkTracerProvider = SdkTracerProvider.builder() .addSpanProcessor(BatchSpanProcessor.builder(OtlpGrpcSpanExporter.builder().build()).build()) From 5224978c211cf0f1584719f6875d3b702530b707 Mon Sep 17 00:00:00 2001 From: Phillip Carter Date: Fri, 26 Apr 2024 15:19:15 -0700 Subject: [PATCH 2/4] Update content/en/docs/languages/java/exporters.md Co-authored-by: Gregor Zeitlinger --- content/en/docs/languages/java/exporters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/docs/languages/java/exporters.md b/content/en/docs/languages/java/exporters.md index 30f32256ac35..beddf58b4efe 100644 --- a/content/en/docs/languages/java/exporters.md +++ b/content/en/docs/languages/java/exporters.md @@ -131,7 +131,7 @@ public class DiceApplication { @Bean public OpenTelemetry openTelemetry() { - Resource resource = Resource.getDefault().toBuilder().put(ResourceAttributes.SERVICE_NAME, "dice-server").put(ResourceAttributes.SERVICE_VERSION, "0.1.0").build(); + Resource resource = Resource.getDefault().toBuilder().put(ServiceAttributes.SERVICE_NAME, "dice-server").put(ServiceAttributes.SERVICE_VERSION, "0.1.0").build(); SdkTracerProvider sdkTracerProvider = SdkTracerProvider.builder() .addSpanProcessor(BatchSpanProcessor.builder(OtlpGrpcSpanExporter.builder().build()).build()) From 22fe1f0bfd51ae891796f9c441fb2909f07ed92a Mon Sep 17 00:00:00 2001 From: Phillip Carter Date: Fri, 26 Apr 2024 15:22:09 -0700 Subject: [PATCH 3/4] Update exporters.md --- content/en/docs/languages/java/exporters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/docs/languages/java/exporters.md b/content/en/docs/languages/java/exporters.md index beddf58b4efe..e90c66d0a1ae 100644 --- a/content/en/docs/languages/java/exporters.md +++ b/content/en/docs/languages/java/exporters.md @@ -119,7 +119,7 @@ import io.opentelemetry.sdk.trace.export.BatchSpanProcessor; import io.opentelemetry.sdk.logs.export.BatchLogRecordProcessor; import io.opentelemetry.sdk.logs.SdkLoggerProvider; import io.opentelemetry.sdk.logs.export.LogRecordExporter; -import io.opentelemetry.semconv.resource.attributes.ResourceAttributes; +import io.opentelemetry.semconv.ServiceAttributes; @SpringBootApplication public class DiceApplication { From f66c06089fa8af1799a9314e5b6e40cb90d656f3 Mon Sep 17 00:00:00 2001 From: Phillip Carter Date: Fri, 26 Apr 2024 15:22:34 -0700 Subject: [PATCH 4/4] Update exporters.md --- content/en/docs/languages/java/exporters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/docs/languages/java/exporters.md b/content/en/docs/languages/java/exporters.md index e90c66d0a1ae..728ae03e3bb6 100644 --- a/content/en/docs/languages/java/exporters.md +++ b/content/en/docs/languages/java/exporters.md @@ -119,7 +119,7 @@ import io.opentelemetry.sdk.trace.export.BatchSpanProcessor; import io.opentelemetry.sdk.logs.export.BatchLogRecordProcessor; import io.opentelemetry.sdk.logs.SdkLoggerProvider; import io.opentelemetry.sdk.logs.export.LogRecordExporter; -import io.opentelemetry.semconv.ServiceAttributes; +import io.opentelemetry.semconv; @SpringBootApplication public class DiceApplication {