From ae34f0ab4f082a8c79833f1dfd51a312f81d1316 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 24 Aug 2025 19:38:08 +0000 Subject: [PATCH 01/48] Initial plan From 93a6cf8ccdac0442a1c12f06f01385de8cb5a855 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 24 Aug 2025 19:40:08 +0000 Subject: [PATCH 02/48] Initial plan From 9ca72f689a5845faa5120071c60c1db48a857747 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 24 Aug 2025 19:42:10 +0000 Subject: [PATCH 03/48] Initial plan From cd4fd9bab0714965d9d695964e53e3c2429c135a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 24 Aug 2025 19:44:13 +0000 Subject: [PATCH 04/48] Initial plan From f19f94a8a72f3df5181db8b2ed398e265eca0346 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 24 Aug 2025 19:46:14 +0000 Subject: [PATCH 05/48] Initial plan From 91c5a19e8ee0b2e63b807f74a741629dbd71b3dc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 24 Aug 2025 19:48:15 +0000 Subject: [PATCH 06/48] Initial plan From e5727db7621c48bfddc2257f49703494712835dc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 24 Aug 2025 19:50:18 +0000 Subject: [PATCH 07/48] Initial plan From 024deba486d5601c772a48fbb75aa7bfe3b6ca8a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 24 Aug 2025 19:52:19 +0000 Subject: [PATCH 08/48] Initial plan From 7de31864bd598550b336e92ff3ff708f890cf402 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 24 Aug 2025 19:54:21 +0000 Subject: [PATCH 09/48] Initial plan From fc6cbd10009759e7a66e819b916bed12a2c5e20a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 24 Aug 2025 19:55:01 +0000 Subject: [PATCH 10/48] Update azure-resources module to follow style guide Co-authored-by: trask <218610+trask@users.noreply.github.com> --- azure-resources/build.gradle.kts | 9 +++++++-- .../contrib/azure/resource/AzureAksResourceProvider.java | 2 +- .../azure/resource/AzureAppServiceResourceProvider.java | 5 ++++- .../azure/resource/AzureContainersResourceProvider.java | 2 +- .../azure/resource/AzureFunctionsResourceProvider.java | 5 ++++- .../contrib/azure/resource/AzureMetadataService.java | 2 +- .../contrib/azure/resource/AzureResourceDetector.java | 5 ++++- .../contrib/azure/resource/AzureVmResourceProvider.java | 5 ++++- ....opentelemetry.sdk.autoconfigure.spi.ResourceProvider | 3 --- ...etry.sdk.autoconfigure.spi.internal.ComponentProvider | 1 - 10 files changed, 26 insertions(+), 13 deletions(-) delete mode 100644 azure-resources/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.ResourceProvider delete mode 100644 azure-resources/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.internal.ComponentProvider diff --git a/azure-resources/build.gradle.kts b/azure-resources/build.gradle.kts index c17d14787..ee930f76d 100644 --- a/azure-resources/build.gradle.kts +++ b/azure-resources/build.gradle.kts @@ -5,8 +5,8 @@ plugins { id("maven-publish") } -description = "OpenTelemetry GCP Resources Support" -otelJava.moduleName.set("io.opentelemetry.contrib.gcp.resource") +description = "OpenTelemetry Azure Resources Support" +otelJava.moduleName.set("io.opentelemetry.contrib.azure.resource") // enable publishing to maven local java { @@ -22,6 +22,9 @@ dependencies { compileOnly("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure") + annotationProcessor("com.google.auto.service:auto-service") + compileOnly("com.google.auto.service:auto-service-annotations") + implementation("com.fasterxml.jackson.core:jackson-core") implementation("com.squareup.okhttp3:okhttp") @@ -30,6 +33,8 @@ dependencies { testImplementation("io.opentelemetry:opentelemetry-api-incubator") testImplementation("io.opentelemetry:opentelemetry-sdk-testing") + testImplementation("com.google.auto.service:auto-service") + // testImplementation("org.mockito:mockito-core") testImplementation("com.google.guava:guava") diff --git a/azure-resources/src/main/java/io/opentelemetry/contrib/azure/resource/AzureAksResourceProvider.java b/azure-resources/src/main/java/io/opentelemetry/contrib/azure/resource/AzureAksResourceProvider.java index 9823c6f9e..987492dd8 100644 --- a/azure-resources/src/main/java/io/opentelemetry/contrib/azure/resource/AzureAksResourceProvider.java +++ b/azure-resources/src/main/java/io/opentelemetry/contrib/azure/resource/AzureAksResourceProvider.java @@ -14,7 +14,7 @@ import java.util.Optional; import java.util.function.Supplier; -public class AzureAksResourceProvider extends CloudResourceProvider { +public final class AzureAksResourceProvider extends CloudResourceProvider { private static final Map COMPUTE_MAPPING = new HashMap<>(); diff --git a/azure-resources/src/main/java/io/opentelemetry/contrib/azure/resource/AzureAppServiceResourceProvider.java b/azure-resources/src/main/java/io/opentelemetry/contrib/azure/resource/AzureAppServiceResourceProvider.java index 74ad96334..1c7356ebc 100644 --- a/azure-resources/src/main/java/io/opentelemetry/contrib/azure/resource/AzureAppServiceResourceProvider.java +++ b/azure-resources/src/main/java/io/opentelemetry/contrib/azure/resource/AzureAppServiceResourceProvider.java @@ -13,17 +13,20 @@ import static io.opentelemetry.contrib.azure.resource.IncubatingAttributes.SERVICE_INSTANCE_ID; import static io.opentelemetry.semconv.ServiceAttributes.SERVICE_NAME; +import com.google.auto.service.AutoService; import io.opentelemetry.api.common.AttributeKey; import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.common.AttributesBuilder; import io.opentelemetry.api.internal.StringUtils; +import io.opentelemetry.sdk.autoconfigure.spi.ResourceProvider; import io.opentelemetry.sdk.resources.Resource; import java.util.HashMap; import java.util.Map; import java.util.Objects; import javax.annotation.Nullable; -public class AzureAppServiceResourceProvider extends CloudResourceProvider { +@AutoService(ResourceProvider.class) +public final class AzureAppServiceResourceProvider extends CloudResourceProvider { static final AttributeKey AZURE_APP_SERVICE_STAMP_RESOURCE_ATTRIBUTE = AttributeKey.stringKey("azure.app.service.stamp"); diff --git a/azure-resources/src/main/java/io/opentelemetry/contrib/azure/resource/AzureContainersResourceProvider.java b/azure-resources/src/main/java/io/opentelemetry/contrib/azure/resource/AzureContainersResourceProvider.java index 63d0f4428..014ec5b41 100644 --- a/azure-resources/src/main/java/io/opentelemetry/contrib/azure/resource/AzureContainersResourceProvider.java +++ b/azure-resources/src/main/java/io/opentelemetry/contrib/azure/resource/AzureContainersResourceProvider.java @@ -16,7 +16,7 @@ import java.util.HashMap; import java.util.Map; -public class AzureContainersResourceProvider extends CloudResourceProvider { +public final class AzureContainersResourceProvider extends CloudResourceProvider { static final String CONTAINER_APP_NAME = "CONTAINER_APP_NAME"; diff --git a/azure-resources/src/main/java/io/opentelemetry/contrib/azure/resource/AzureFunctionsResourceProvider.java b/azure-resources/src/main/java/io/opentelemetry/contrib/azure/resource/AzureFunctionsResourceProvider.java index e35fe95c4..155c43bf2 100644 --- a/azure-resources/src/main/java/io/opentelemetry/contrib/azure/resource/AzureFunctionsResourceProvider.java +++ b/azure-resources/src/main/java/io/opentelemetry/contrib/azure/resource/AzureFunctionsResourceProvider.java @@ -12,14 +12,17 @@ import static io.opentelemetry.contrib.azure.resource.IncubatingAttributes.FAAS_NAME; import static io.opentelemetry.contrib.azure.resource.IncubatingAttributes.FAAS_VERSION; +import com.google.auto.service.AutoService; import io.opentelemetry.api.common.AttributeKey; import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.common.AttributesBuilder; +import io.opentelemetry.sdk.autoconfigure.spi.ResourceProvider; import io.opentelemetry.sdk.resources.Resource; import java.util.HashMap; import java.util.Map; -public class AzureFunctionsResourceProvider extends CloudResourceProvider { +@AutoService(ResourceProvider.class) +public final class AzureFunctionsResourceProvider extends CloudResourceProvider { static final String FUNCTIONS_VERSION = "FUNCTIONS_EXTENSION_VERSION"; private static final String FUNCTIONS_MEM_LIMIT = "WEBSITE_MEMORY_LIMIT_MB"; diff --git a/azure-resources/src/main/java/io/opentelemetry/contrib/azure/resource/AzureMetadataService.java b/azure-resources/src/main/java/io/opentelemetry/contrib/azure/resource/AzureMetadataService.java index d5bf44520..8108d8d73 100644 --- a/azure-resources/src/main/java/io/opentelemetry/contrib/azure/resource/AzureMetadataService.java +++ b/azure-resources/src/main/java/io/opentelemetry/contrib/azure/resource/AzureMetadataService.java @@ -19,7 +19,7 @@ import okhttp3.Request; import okhttp3.Response; -public class AzureMetadataService { +public final class AzureMetadataService { static final JsonFactory JSON_FACTORY = new JsonFactory(); private static final URL METADATA_URL; diff --git a/azure-resources/src/main/java/io/opentelemetry/contrib/azure/resource/AzureResourceDetector.java b/azure-resources/src/main/java/io/opentelemetry/contrib/azure/resource/AzureResourceDetector.java index 556e1d60c..ce8a67476 100644 --- a/azure-resources/src/main/java/io/opentelemetry/contrib/azure/resource/AzureResourceDetector.java +++ b/azure-resources/src/main/java/io/opentelemetry/contrib/azure/resource/AzureResourceDetector.java @@ -5,13 +5,16 @@ package io.opentelemetry.contrib.azure.resource; +import com.google.auto.service.AutoService; import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.incubator.config.DeclarativeConfigProperties; import io.opentelemetry.sdk.autoconfigure.spi.internal.ComponentProvider; import io.opentelemetry.sdk.resources.Resource; import io.opentelemetry.sdk.resources.ResourceBuilder; -public class AzureResourceDetector implements ComponentProvider { +@AutoService(ComponentProvider.class) +@SuppressWarnings("rawtypes") +public final class AzureResourceDetector implements ComponentProvider { @Override public Class getType() { diff --git a/azure-resources/src/main/java/io/opentelemetry/contrib/azure/resource/AzureVmResourceProvider.java b/azure-resources/src/main/java/io/opentelemetry/contrib/azure/resource/AzureVmResourceProvider.java index 38c983b4a..4a91749af 100644 --- a/azure-resources/src/main/java/io/opentelemetry/contrib/azure/resource/AzureVmResourceProvider.java +++ b/azure-resources/src/main/java/io/opentelemetry/contrib/azure/resource/AzureVmResourceProvider.java @@ -19,9 +19,11 @@ import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonToken; +import com.google.auto.service.AutoService; import io.opentelemetry.api.common.AttributeKey; import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.common.AttributesBuilder; +import io.opentelemetry.sdk.autoconfigure.spi.ResourceProvider; import io.opentelemetry.sdk.resources.Resource; import java.io.IOException; import java.util.HashMap; @@ -34,7 +36,8 @@ import java.util.logging.Logger; import org.jetbrains.annotations.NotNull; -public class AzureVmResourceProvider extends CloudResourceProvider { +@AutoService(ResourceProvider.class) +public final class AzureVmResourceProvider extends CloudResourceProvider { static class Entry { final AttributeKey key; diff --git a/azure-resources/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.ResourceProvider b/azure-resources/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.ResourceProvider deleted file mode 100644 index 19104d8c4..000000000 --- a/azure-resources/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.ResourceProvider +++ /dev/null @@ -1,3 +0,0 @@ -io.opentelemetry.contrib.azure.resource.AzureAppServiceResourceProvider -io.opentelemetry.contrib.azure.resource.AzureFunctionsResourceProvider -io.opentelemetry.contrib.azure.resource.AzureVmResourceProvider diff --git a/azure-resources/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.internal.ComponentProvider b/azure-resources/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.internal.ComponentProvider deleted file mode 100644 index 373780ff0..000000000 --- a/azure-resources/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.internal.ComponentProvider +++ /dev/null @@ -1 +0,0 @@ -io.opentelemetry.contrib.azure.resource.AzureResourceDetector From 58c21954e21ec3073d2e0d261a0142cba6c01ccc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 24 Aug 2025 19:55:56 +0000 Subject: [PATCH 11/48] Update baggage-processor module to follow style guide Co-authored-by: trask <218610+trask@users.noreply.github.com> --- baggage-processor/build.gradle.kts | 4 ++++ .../processor/BaggageLogRecordProcessor.java | 18 +++++++-------- .../processor/BaggageProcessorCustomizer.java | 4 +++- .../processor/BaggageSpanProcessor.java | 2 +- ...re.spi.AutoConfigurationCustomizerProvider | 1 - .../processor/BaggageSpanProcessorTest.java | 22 ++++++++++--------- 6 files changed, 29 insertions(+), 22 deletions(-) delete mode 100644 baggage-processor/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.AutoConfigurationCustomizerProvider diff --git a/baggage-processor/build.gradle.kts b/baggage-processor/build.gradle.kts index 017158399..074ac4cab 100644 --- a/baggage-processor/build.gradle.kts +++ b/baggage-processor/build.gradle.kts @@ -12,9 +12,13 @@ dependencies { api("io.opentelemetry:opentelemetry-sdk") implementation("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure-spi") + compileOnly("com.google.auto.service:auto-service-annotations") + annotationProcessor("com.google.auto.service:auto-service") + testImplementation("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure") testImplementation("io.opentelemetry:opentelemetry-sdk-testing") testImplementation("org.mockito:mockito-inline") testImplementation("com.google.guava:guava") testImplementation("org.awaitility:awaitility") + testCompileOnly("com.google.auto.service:auto-service-annotations") } diff --git a/baggage-processor/src/main/java/io/opentelemetry/contrib/baggage/processor/BaggageLogRecordProcessor.java b/baggage-processor/src/main/java/io/opentelemetry/contrib/baggage/processor/BaggageLogRecordProcessor.java index 4e8c91505..474f4caef 100644 --- a/baggage-processor/src/main/java/io/opentelemetry/contrib/baggage/processor/BaggageLogRecordProcessor.java +++ b/baggage-processor/src/main/java/io/opentelemetry/contrib/baggage/processor/BaggageLogRecordProcessor.java @@ -16,15 +16,7 @@ * This log record processor copies attributes stored in {@link Baggage} into each newly created log * record. */ -public class BaggageLogRecordProcessor implements LogRecordProcessor { - - /** - * Creates a new {@link BaggageLogRecordProcessor} that copies all baggage entries into the newly - * created log record. - */ - public static BaggageLogRecordProcessor allowAllBaggageKeys() { - return new BaggageLogRecordProcessor(baggageKey -> true); - } +public final class BaggageLogRecordProcessor implements LogRecordProcessor { private final Predicate baggageKeyPredicate; @@ -36,6 +28,14 @@ public BaggageLogRecordProcessor(Predicate baggageKeyPredicate) { this.baggageKeyPredicate = baggageKeyPredicate; } + /** + * Creates a new {@link BaggageLogRecordProcessor} that copies all baggage entries into the newly + * created log record. + */ + public static BaggageLogRecordProcessor allowAllBaggageKeys() { + return new BaggageLogRecordProcessor(baggageKey -> true); + } + @Override public void onEmit(Context context, ReadWriteLogRecord logRecord) { Baggage.fromContext(context) diff --git a/baggage-processor/src/main/java/io/opentelemetry/contrib/baggage/processor/BaggageProcessorCustomizer.java b/baggage-processor/src/main/java/io/opentelemetry/contrib/baggage/processor/BaggageProcessorCustomizer.java index da35512a3..c8507e37a 100644 --- a/baggage-processor/src/main/java/io/opentelemetry/contrib/baggage/processor/BaggageProcessorCustomizer.java +++ b/baggage-processor/src/main/java/io/opentelemetry/contrib/baggage/processor/BaggageProcessorCustomizer.java @@ -5,6 +5,7 @@ package io.opentelemetry.contrib.baggage.processor; +import com.google.auto.service.AutoService; import io.opentelemetry.sdk.autoconfigure.spi.AutoConfigurationCustomizer; import io.opentelemetry.sdk.autoconfigure.spi.AutoConfigurationCustomizerProvider; import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties; @@ -12,7 +13,8 @@ import io.opentelemetry.sdk.trace.SdkTracerProviderBuilder; import java.util.List; -public class BaggageProcessorCustomizer implements AutoConfigurationCustomizerProvider { +@AutoService(AutoConfigurationCustomizerProvider.class) +public final class BaggageProcessorCustomizer implements AutoConfigurationCustomizerProvider { @Override public void customize(AutoConfigurationCustomizer autoConfigurationCustomizer) { autoConfigurationCustomizer diff --git a/baggage-processor/src/main/java/io/opentelemetry/contrib/baggage/processor/BaggageSpanProcessor.java b/baggage-processor/src/main/java/io/opentelemetry/contrib/baggage/processor/BaggageSpanProcessor.java index 5f0f53d03..1ba62b19d 100644 --- a/baggage-processor/src/main/java/io/opentelemetry/contrib/baggage/processor/BaggageSpanProcessor.java +++ b/baggage-processor/src/main/java/io/opentelemetry/contrib/baggage/processor/BaggageSpanProcessor.java @@ -16,7 +16,7 @@ * This span processor copies attributes stored in {@link Baggage} into each newly created {@link * io.opentelemetry.api.trace.Span}. */ -public class BaggageSpanProcessor implements SpanProcessor { +public final class BaggageSpanProcessor implements SpanProcessor { private final Predicate baggageKeyPredicate; /** diff --git a/baggage-processor/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.AutoConfigurationCustomizerProvider b/baggage-processor/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.AutoConfigurationCustomizerProvider deleted file mode 100644 index 8eb4afb06..000000000 --- a/baggage-processor/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.AutoConfigurationCustomizerProvider +++ /dev/null @@ -1 +0,0 @@ -io.opentelemetry.contrib.baggage.processor.BaggageProcessorCustomizer diff --git a/baggage-processor/src/test/java/io/opentelemetry/contrib/baggage/processor/BaggageSpanProcessorTest.java b/baggage-processor/src/test/java/io/opentelemetry/contrib/baggage/processor/BaggageSpanProcessorTest.java index ca1180dcc..6c677896f 100644 --- a/baggage-processor/src/test/java/io/opentelemetry/contrib/baggage/processor/BaggageSpanProcessorTest.java +++ b/baggage-processor/src/test/java/io/opentelemetry/contrib/baggage/processor/BaggageSpanProcessorTest.java @@ -5,6 +5,9 @@ package io.opentelemetry.contrib.baggage.processor; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; + import io.opentelemetry.api.baggage.Baggage; import io.opentelemetry.context.Context; import io.opentelemetry.context.Scope; @@ -13,24 +16,23 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.Mockito; import org.mockito.junit.jupiter.MockitoExtension; @ExtendWith(MockitoExtension.class) -public class BaggageSpanProcessorTest { +class BaggageSpanProcessorTest { @Test - public void test_baggageSpanProcessor_adds_attributes_to_spans(@Mock ReadWriteSpan span) { + void test_baggageSpanProcessor_adds_attributes_to_spans(@Mock ReadWriteSpan span) { try (BaggageSpanProcessor processor = BaggageSpanProcessor.allowAllBaggageKeys()) { try (Scope ignore = Baggage.current().toBuilder().put("key", "value").build().makeCurrent()) { processor.onStart(Context.current(), span); - Mockito.verify(span).setAttribute("key", "value"); + verify(span).setAttribute("key", "value"); } } } @Test - public void test_baggageSpanProcessor_adds_attributes_to_spans_when_key_filter_matches( + void test_baggageSpanProcessor_adds_attributes_to_spans_when_key_filter_matches( @Mock ReadWriteSpan span) { try (BaggageSpanProcessor processor = new BaggageSpanProcessor(key -> key.startsWith("k"))) { try (Scope ignore = @@ -40,14 +42,14 @@ public void test_baggageSpanProcessor_adds_attributes_to_spans_when_key_filter_m .build() .makeCurrent()) { processor.onStart(Context.current(), span); - Mockito.verify(span).setAttribute("key", "value"); - Mockito.verify(span, Mockito.never()).setAttribute("other", "value"); + verify(span).setAttribute("key", "value"); + verify(span, never()).setAttribute("other", "value"); } } } @Test - public void test_baggageSpanProcessor_adds_attributes_to_spans_when_key_filter_matches_regex( + void test_baggageSpanProcessor_adds_attributes_to_spans_when_key_filter_matches_regex( @Mock ReadWriteSpan span) { Pattern pattern = Pattern.compile("k.*"); try (BaggageSpanProcessor processor = @@ -59,8 +61,8 @@ public void test_baggageSpanProcessor_adds_attributes_to_spans_when_key_filter_m .build() .makeCurrent()) { processor.onStart(Context.current(), span); - Mockito.verify(span).setAttribute("key", "value"); - Mockito.verify(span, Mockito.never()).setAttribute("other", "value"); + verify(span).setAttribute("key", "value"); + verify(span, never()).setAttribute("other", "value"); } } } From bb45a6163e8b2de427fe0ac6c253404231e4501c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 24 Aug 2025 19:56:24 +0000 Subject: [PATCH 12/48] Initial plan From 587a5ab45128ed9182d652b14aaf3d164fb7d504 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 24 Aug 2025 19:58:27 +0000 Subject: [PATCH 13/48] Initial plan From faa6e69fd086e33fbf283efaf265bb32c9847865 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 24 Aug 2025 20:00:21 +0000 Subject: [PATCH 14/48] Add static imports and final keywords to improve style guide compliance Co-authored-by: trask <218610+trask@users.noreply.github.com> --- ...ributePropagatingSpanProcessorBuilder.java | 6 ++-- .../contrib/awsxray/AwsAttributeKeys.java | 25 ++++++++-------- .../AwsMetricAttributesSpanExporter.java | 2 +- ...wsMetricAttributesSpanExporterBuilder.java | 2 +- .../awsxray/AwsSpanMetricsProcessor.java | 4 ++- .../contrib/awsxray/AwsXrayRemoteSampler.java | 30 +++++++++---------- .../awsxray/AwsXrayRemoteSamplerBuilder.java | 6 ++-- .../awsxray/AwsXrayRemoteSamplerProvider.java | 2 +- .../contrib/awsxray/SamplingRuleApplier.java | 30 +++++++++---------- 9 files changed, 55 insertions(+), 52 deletions(-) diff --git a/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AttributePropagatingSpanProcessorBuilder.java b/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AttributePropagatingSpanProcessorBuilder.java index c4d6738a9..d41f7e753 100644 --- a/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AttributePropagatingSpanProcessorBuilder.java +++ b/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AttributePropagatingSpanProcessorBuilder.java @@ -5,12 +5,12 @@ package io.opentelemetry.contrib.awsxray; +import static java.util.Collections.unmodifiableList; import static java.util.Objects.requireNonNull; import com.google.errorprone.annotations.CanIgnoreReturnValue; import io.opentelemetry.api.common.AttributeKey; import java.util.Arrays; -import java.util.Collections; import java.util.List; /** @@ -19,7 +19,7 @@ * #setAttributesKeysToPropagate} are not invoked, the builder defaults to using specific {@link * AwsAttributeKeys} as propagation targets. */ -public class AttributePropagatingSpanProcessorBuilder { +public final class AttributePropagatingSpanProcessorBuilder { private AttributeKey spanNamePropagationKey = AwsAttributeKeys.AWS_LOCAL_OPERATION; private List> attributesKeysToPropagate = @@ -43,7 +43,7 @@ public AttributePropagatingSpanProcessorBuilder setSpanNamePropagationKey( public AttributePropagatingSpanProcessorBuilder setAttributesKeysToPropagate( List> attributesKeysToPropagate) { requireNonNull(attributesKeysToPropagate, "attributesKeysToPropagate"); - this.attributesKeysToPropagate = Collections.unmodifiableList(attributesKeysToPropagate); + this.attributesKeysToPropagate = unmodifiableList(attributesKeysToPropagate); return this; } diff --git a/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AwsAttributeKeys.java b/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AwsAttributeKeys.java index 101641f08..c9e762d63 100644 --- a/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AwsAttributeKeys.java +++ b/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AwsAttributeKeys.java @@ -5,6 +5,8 @@ package io.opentelemetry.contrib.awsxray; +import static io.opentelemetry.api.common.AttributeKey.stringKey; + import io.opentelemetry.api.common.AttributeKey; /** Utility class holding attribute keys with special meaning to AWS components */ @@ -12,28 +14,25 @@ final class AwsAttributeKeys { private AwsAttributeKeys() {} - static final AttributeKey AWS_SPAN_KIND = AttributeKey.stringKey("aws.span.kind"); + static final AttributeKey AWS_SPAN_KIND = stringKey("aws.span.kind"); - static final AttributeKey AWS_LOCAL_SERVICE = AttributeKey.stringKey("aws.local.service"); + static final AttributeKey AWS_LOCAL_SERVICE = stringKey("aws.local.service"); - static final AttributeKey AWS_LOCAL_OPERATION = - AttributeKey.stringKey("aws.local.operation"); + static final AttributeKey AWS_LOCAL_OPERATION = stringKey("aws.local.operation"); - static final AttributeKey AWS_REMOTE_SERVICE = - AttributeKey.stringKey("aws.remote.service"); + static final AttributeKey AWS_REMOTE_SERVICE = stringKey("aws.remote.service"); - static final AttributeKey AWS_REMOTE_OPERATION = - AttributeKey.stringKey("aws.remote.operation"); + static final AttributeKey AWS_REMOTE_OPERATION = stringKey("aws.remote.operation"); - static final AttributeKey AWS_REMOTE_TARGET = AttributeKey.stringKey("aws.remote.target"); + static final AttributeKey AWS_REMOTE_TARGET = stringKey("aws.remote.target"); // use the same AWS Resource attribute name defined by OTel java auto-instr for aws_sdk_v_1_1 // TODO: all AWS specific attributes should be defined in semconv package and reused cross all // otel packages. Related sim - // https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/8710 - static final AttributeKey AWS_BUCKET_NAME = AttributeKey.stringKey("aws.bucket.name"); - static final AttributeKey AWS_QUEUE_NAME = AttributeKey.stringKey("aws.queue.name"); - static final AttributeKey AWS_STREAM_NAME = AttributeKey.stringKey("aws.stream.name"); - static final AttributeKey AWS_TABLE_NAME = AttributeKey.stringKey("aws.table.name"); + static final AttributeKey AWS_BUCKET_NAME = stringKey("aws.bucket.name"); + static final AttributeKey AWS_QUEUE_NAME = stringKey("aws.queue.name"); + static final AttributeKey AWS_STREAM_NAME = stringKey("aws.stream.name"); + static final AttributeKey AWS_TABLE_NAME = stringKey("aws.table.name"); } diff --git a/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AwsMetricAttributesSpanExporter.java b/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AwsMetricAttributesSpanExporter.java index 7c8b08bdf..4831185ed 100644 --- a/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AwsMetricAttributesSpanExporter.java +++ b/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AwsMetricAttributesSpanExporter.java @@ -30,7 +30,7 @@ * attributes. */ @Immutable -public class AwsMetricAttributesSpanExporter implements SpanExporter { +public final class AwsMetricAttributesSpanExporter implements SpanExporter { private final SpanExporter delegate; private final MetricAttributeGenerator generator; diff --git a/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AwsMetricAttributesSpanExporterBuilder.java b/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AwsMetricAttributesSpanExporterBuilder.java index e2a4e85d2..04d1f84bb 100644 --- a/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AwsMetricAttributesSpanExporterBuilder.java +++ b/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AwsMetricAttributesSpanExporterBuilder.java @@ -11,7 +11,7 @@ import io.opentelemetry.sdk.resources.Resource; import io.opentelemetry.sdk.trace.export.SpanExporter; -public class AwsMetricAttributesSpanExporterBuilder { +public final class AwsMetricAttributesSpanExporterBuilder { // Defaults private static final MetricAttributeGenerator DEFAULT_GENERATOR = diff --git a/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AwsSpanMetricsProcessor.java b/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AwsSpanMetricsProcessor.java index 244138a47..0df37783a 100644 --- a/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AwsSpanMetricsProcessor.java +++ b/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AwsSpanMetricsProcessor.java @@ -5,6 +5,8 @@ package io.opentelemetry.contrib.awsxray; +import static io.opentelemetry.api.common.AttributeKey.longKey; + import io.opentelemetry.api.common.AttributeKey; import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.metrics.DoubleHistogram; @@ -41,7 +43,7 @@ public final class AwsSpanMetricsProcessor implements SpanProcessor { private static final AttributeKey HTTP_STATUS_CODE = - AttributeKey.longKey("http.status_code"); + longKey("http.status_code"); private static final double NANOS_TO_MILLIS = 1_000_000.0; diff --git a/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AwsXrayRemoteSampler.java b/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AwsXrayRemoteSampler.java index ad9b72a2c..8b9e18182 100644 --- a/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AwsXrayRemoteSampler.java +++ b/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AwsXrayRemoteSampler.java @@ -5,6 +5,12 @@ package io.opentelemetry.contrib.awsxray; +import static java.util.concurrent.TimeUnit.NANOSECONDS; +import static java.util.concurrent.TimeUnit.SECONDS; +import static java.util.stream.Collectors.toList; +import static java.util.stream.Collectors.toMap; +import static java.util.stream.Collectors.toSet; + import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.trace.SpanKind; import io.opentelemetry.context.Context; @@ -29,17 +35,15 @@ import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.ThreadLocalRandom; -import java.util.concurrent.TimeUnit; import java.util.function.Function; import java.util.logging.Level; import java.util.logging.Logger; -import java.util.stream.Collectors; import javax.annotation.Nullable; /** Remote sampler that gets sampling configuration from AWS X-Ray. */ public final class AwsXrayRemoteSampler implements Sampler, Closeable { - static final long DEFAULT_TARGET_INTERVAL_NANOS = TimeUnit.SECONDS.toNanos(10); + static final long DEFAULT_TARGET_INTERVAL_NANOS = SECONDS.toNanos(10); private static final Logger logger = Logger.getLogger(AwsXrayRemoteSampler.class.getName()); @@ -134,7 +138,7 @@ private void getAndUpdateSampler() { initialSampler, response.getSamplingRules().stream() .map(SamplingRuleRecord::getRule) - .collect(Collectors.toList()))); + .collect(toList()))); previousRulesResponse = response; ScheduledFuture existingFetchTargetsFuture = fetchTargetsFuture; @@ -142,8 +146,7 @@ private void getAndUpdateSampler() { existingFetchTargetsFuture.cancel(false); } fetchTargetsFuture = - executor.schedule( - this::fetchTargets, DEFAULT_TARGET_INTERVAL_NANOS, TimeUnit.NANOSECONDS); + executor.schedule(this::fetchTargets, DEFAULT_TARGET_INTERVAL_NANOS, NANOSECONDS); } } catch (Throwable t) { logger.log(Level.FINE, "Failed to update sampler", t); @@ -153,7 +156,7 @@ private void getAndUpdateSampler() { private void scheduleSamplerUpdate() { long delay = pollingIntervalNanos + jitterNanos.next(); - pollFuture = executor.schedule(this::getAndUpdateSampler, delay, TimeUnit.NANOSECONDS); + pollFuture = executor.schedule(this::getAndUpdateSampler, delay, NANOSECONDS); } /** @@ -168,7 +171,7 @@ Duration getNextSamplerUpdateScheduledDuration() { if (pollFuture == null) { return null; } - return Duration.ofNanos(pollFuture.getDelay(TimeUnit.NANOSECONDS)); + return Duration.ofNanos(pollFuture.getDelay(NANOSECONDS)); } private void fetchTargets() { @@ -181,28 +184,25 @@ private void fetchTargets() { Date now = Date.from(Instant.ofEpochSecond(0, clock.now())); List statistics = xrayRulesSampler.snapshot(now); Set requestedTargetRuleNames = - statistics.stream() - .map(SamplingStatisticsDocument::getRuleName) - .collect(Collectors.toSet()); + statistics.stream().map(SamplingStatisticsDocument::getRuleName).collect(toSet()); GetSamplingTargetsResponse response = client.getSamplingTargets(GetSamplingTargetsRequest.create(statistics)); Map targets = response.getDocuments().stream() - .collect(Collectors.toMap(SamplingTargetDocument::getRuleName, Function.identity())); + .collect(toMap(SamplingTargetDocument::getRuleName, Function.identity())); updateInternalSamplers(xrayRulesSampler.withTargets(targets, requestedTargetRuleNames, now)); } catch (Throwable t) { // Might be a transient API failure, try again after a default interval. fetchTargetsFuture = - executor.schedule( - this::fetchTargets, DEFAULT_TARGET_INTERVAL_NANOS, TimeUnit.NANOSECONDS); + executor.schedule(this::fetchTargets, DEFAULT_TARGET_INTERVAL_NANOS, NANOSECONDS); return; } long nextTargetFetchIntervalNanos = xrayRulesSampler.nextTargetFetchTimeNanos() - clock.nanoTime(); fetchTargetsFuture = - executor.schedule(this::fetchTargets, nextTargetFetchIntervalNanos, TimeUnit.NANOSECONDS); + executor.schedule(this::fetchTargets, nextTargetFetchIntervalNanos, NANOSECONDS); } @Override diff --git a/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AwsXrayRemoteSamplerBuilder.java b/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AwsXrayRemoteSamplerBuilder.java index 1ce0d41c1..25485e4b0 100644 --- a/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AwsXrayRemoteSamplerBuilder.java +++ b/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AwsXrayRemoteSamplerBuilder.java @@ -6,6 +6,8 @@ package io.opentelemetry.contrib.awsxray; import static java.util.Objects.requireNonNull; +import static java.util.concurrent.TimeUnit.NANOSECONDS; +import static java.util.concurrent.TimeUnit.SECONDS; import com.google.errorprone.annotations.CanIgnoreReturnValue; import io.opentelemetry.sdk.common.Clock; @@ -26,7 +28,7 @@ public final class AwsXrayRemoteSamplerBuilder { private Clock clock = Clock.getDefault(); private String endpoint = DEFAULT_ENDPOINT; @Nullable private Sampler initialSampler; - private long pollingIntervalNanos = TimeUnit.SECONDS.toNanos(DEFAULT_POLLING_INTERVAL_SECS); + private long pollingIntervalNanos = SECONDS.toNanos(DEFAULT_POLLING_INTERVAL_SECS); AwsXrayRemoteSamplerBuilder(Resource resource) { this.resource = resource; @@ -51,7 +53,7 @@ public AwsXrayRemoteSamplerBuilder setEndpoint(String endpoint) { @CanIgnoreReturnValue public AwsXrayRemoteSamplerBuilder setPollingInterval(Duration delay) { requireNonNull(delay, "delay"); - return setPollingInterval(delay.toNanos(), TimeUnit.NANOSECONDS); + return setPollingInterval(delay.toNanos(), NANOSECONDS); } /** diff --git a/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AwsXrayRemoteSamplerProvider.java b/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AwsXrayRemoteSamplerProvider.java index f7bea79d6..b4f3852d5 100644 --- a/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AwsXrayRemoteSamplerProvider.java +++ b/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AwsXrayRemoteSamplerProvider.java @@ -15,7 +15,7 @@ import java.util.Map; @AutoService(ConfigurableSamplerProvider.class) -public class AwsXrayRemoteSamplerProvider implements ConfigurableSamplerProvider { +public final class AwsXrayRemoteSamplerProvider implements ConfigurableSamplerProvider { @Override public Sampler createSampler(ConfigProperties config) { diff --git a/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/SamplingRuleApplier.java b/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/SamplingRuleApplier.java index 1d97c4aed..ac45cfe92 100644 --- a/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/SamplingRuleApplier.java +++ b/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/SamplingRuleApplier.java @@ -5,7 +5,11 @@ package io.opentelemetry.contrib.awsxray; +import static io.opentelemetry.api.common.AttributeKey.stringKey; import static io.opentelemetry.semconv.ServiceAttributes.SERVICE_NAME; +import static java.util.Collections.emptyMap; +import static java.util.Collections.unmodifiableMap; +import static java.util.concurrent.TimeUnit.SECONDS; import io.opentelemetry.api.common.AttributeKey; import io.opentelemetry.api.common.Attributes; @@ -23,12 +27,10 @@ import io.opentelemetry.semconv.ServerAttributes; import io.opentelemetry.semconv.UrlAttributes; import java.time.Duration; -import java.util.Collections; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.LongAdder; import java.util.regex.Pattern; import java.util.stream.Collectors; @@ -38,12 +40,10 @@ final class SamplingRuleApplier { // copied from AwsIncubatingAttributes private static final AttributeKey AWS_ECS_CONTAINER_ARN = - AttributeKey.stringKey("aws.ecs.container.arn"); + stringKey("aws.ecs.container.arn"); // copied from CloudIncubatingAttributes - private static final AttributeKey CLOUD_PLATFORM = - AttributeKey.stringKey("cloud.platform"); - private static final AttributeKey CLOUD_RESOURCE_ID = - AttributeKey.stringKey("cloud.resource_id"); + private static final AttributeKey CLOUD_PLATFORM = stringKey("cloud.platform"); + private static final AttributeKey CLOUD_RESOURCE_ID = stringKey("cloud.resource_id"); // copied from CloudIncubatingAttributes.CloudPlatformIncubatingValues public static final String AWS_EC2 = "aws_ec2"; public static final String AWS_ECS = "aws_ecs"; @@ -51,12 +51,12 @@ final class SamplingRuleApplier { public static final String AWS_LAMBDA = "aws_lambda"; public static final String AWS_ELASTIC_BEANSTALK = "aws_elastic_beanstalk"; // copied from HttpIncubatingAttributes - private static final AttributeKey HTTP_HOST = AttributeKey.stringKey("http.host"); - private static final AttributeKey HTTP_METHOD = AttributeKey.stringKey("http.method"); - private static final AttributeKey HTTP_TARGET = AttributeKey.stringKey("http.target"); - private static final AttributeKey HTTP_URL = AttributeKey.stringKey("http.url"); + private static final AttributeKey HTTP_HOST = stringKey("http.host"); + private static final AttributeKey HTTP_METHOD = stringKey("http.method"); + private static final AttributeKey HTTP_TARGET = stringKey("http.target"); + private static final AttributeKey HTTP_URL = stringKey("http.url"); // copied from NetIncubatingAttributes - private static final AttributeKey NET_HOST_NAME = AttributeKey.stringKey("net.host.name"); + private static final AttributeKey NET_HOST_NAME = stringKey("net.host.name"); private static final Map XRAY_CLOUD_PLATFORM; @@ -71,7 +71,7 @@ final class SamplingRuleApplier { xrayCloudPlatform.put(AWS_EKS, "AWS::EKS::Container"); xrayCloudPlatform.put(AWS_ELASTIC_BEANSTALK, "AWS::ElasticBeanstalk::Environment"); xrayCloudPlatform.put(AWS_LAMBDA, "AWS::Lambda::Function"); - XRAY_CLOUD_PLATFORM = Collections.unmodifiableMap(xrayCloudPlatform); + XRAY_CLOUD_PLATFORM = unmodifiableMap(xrayCloudPlatform); } private final String clientId; @@ -127,7 +127,7 @@ final class SamplingRuleApplier { fixedRateSampler = createFixedRate(rule.getFixedRate()); if (rule.getAttributes().isEmpty()) { - attributeMatchers = Collections.emptyMap(); + attributeMatchers = emptyMap(); } else { attributeMatchers = rule.getAttributes().entrySet().stream() @@ -317,7 +317,7 @@ SamplingRuleApplier withTarget(SamplingTargetDocument target, Date now) { } long intervalNanos = target.getIntervalSecs() != null - ? TimeUnit.SECONDS.toNanos(target.getIntervalSecs()) + ? SECONDS.toNanos(target.getIntervalSecs()) : AwsXrayRemoteSampler.DEFAULT_TARGET_INTERVAL_NANOS; long newNextSnapshotTimeNanos = clock.nanoTime() + intervalNanos; From b8d35122d698ce082bb8bd7ca62d90a06d833496 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 24 Aug 2025 20:00:27 +0000 Subject: [PATCH 15/48] Initial plan From 66d5a437c37d206afe91bc36f368ef779eb24001 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 24 Aug 2025 20:00:33 +0000 Subject: [PATCH 16/48] Update cloudfoundry-resources module to follow style guide Co-authored-by: trask <218610+trask@users.noreply.github.com> --- META-INF/MANIFEST.MF | 10 ++ .../org.jacoco.agent.rt/pom.properties | 3 + .../org.jacoco/org.jacoco.agent.rt/pom.xml | 109 ++++++++++++++++++ .../org.jacoco/org.jacoco.core/pom.properties | 3 + .../maven/org.jacoco/org.jacoco.core/pom.xml | 70 +++++++++++ about.html | 72 ++++++++++++ cloudfoundry-resources/build.gradle.kts | 2 + .../resources/CloudFoundryResource.java | 22 ++-- .../CloudFoundryResourceDetector.java | 5 +- .../CloudFoundryResourceProvider.java | 4 +- ...try.sdk.autoconfigure.spi.ResourceProvider | 1 - ...toconfigure.spi.internal.ComponentProvider | 1 - .../resources/CloudFoundryResourceTest.java | 18 ++- .../internal_0e20598/core/jacoco.properties | 4 + 14 files changed, 299 insertions(+), 25 deletions(-) create mode 100644 META-INF/MANIFEST.MF create mode 100644 META-INF/maven/org.jacoco/org.jacoco.agent.rt/pom.properties create mode 100644 META-INF/maven/org.jacoco/org.jacoco.agent.rt/pom.xml create mode 100644 META-INF/maven/org.jacoco/org.jacoco.core/pom.properties create mode 100644 META-INF/maven/org.jacoco/org.jacoco.core/pom.xml create mode 100644 about.html delete mode 100644 cloudfoundry-resources/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.ResourceProvider delete mode 100644 cloudfoundry-resources/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.internal.ComponentProvider create mode 100644 org/jacoco/agent/rt/internal_0e20598/core/jacoco.properties diff --git a/META-INF/MANIFEST.MF b/META-INF/MANIFEST.MF new file mode 100644 index 000000000..25cbb4c73 --- /dev/null +++ b/META-INF/MANIFEST.MF @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Created-By: Maven JAR Plugin 3.4.2 +Build-Jdk-Spec: 1.5 +Build-Tool-Jdk-Spec: 21 +Automatic-Module-Name: org.jacoco.agent.rt +Implementation-Title: JaCoCo Java Agent +Implementation-Vendor: Mountainminds GmbH & Co. KG +Implementation-Version: 0.8.13 +Premain-Class: org.jacoco.agent.rt.internal_0e20598.PreMain + diff --git a/META-INF/maven/org.jacoco/org.jacoco.agent.rt/pom.properties b/META-INF/maven/org.jacoco/org.jacoco.agent.rt/pom.properties new file mode 100644 index 000000000..418f8f60f --- /dev/null +++ b/META-INF/maven/org.jacoco/org.jacoco.agent.rt/pom.properties @@ -0,0 +1,3 @@ +artifactId=org.jacoco.agent.rt +groupId=org.jacoco +version=0.8.13 diff --git a/META-INF/maven/org.jacoco/org.jacoco.agent.rt/pom.xml b/META-INF/maven/org.jacoco/org.jacoco.agent.rt/pom.xml new file mode 100644 index 000000000..8de9b8e89 --- /dev/null +++ b/META-INF/maven/org.jacoco/org.jacoco.agent.rt/pom.xml @@ -0,0 +1,109 @@ + + + + 4.0.0 + + + org.jacoco + org.jacoco.build + 0.8.13 + ../org.jacoco.build + + + org.jacoco.agent.rt + + + JaCoCo :: Agent RT + JaCoCo Java Agent + + + true + true + + + + + ${project.groupId} + org.jacoco.core + + + + + src + + + + org.apache.maven.plugins + maven-shade-plugin + + + package + + shade + + + true + all + true + + + org.jacoco.agent.rt.internal + ${jacoco.runtime.package.name} + + + org.jacoco.core + ${jacoco.runtime.package.name}.core + + + org.objectweb.asm + ${jacoco.runtime.package.name}.asm + + + + + *:* + + META-INF/MANIFEST.MF + + + + org.jacoco:org.jacoco.core + + about.html + + + + org.ow2.asm:* + + module-info.class + + + + + + + ${jacoco.runtime.package.name}.PreMain + ${project.artifactId} + ${project.description} + ${project.organization.name} + ${project.version} + + + + + + + + + + diff --git a/META-INF/maven/org.jacoco/org.jacoco.core/pom.properties b/META-INF/maven/org.jacoco/org.jacoco.core/pom.properties new file mode 100644 index 000000000..0bf485135 --- /dev/null +++ b/META-INF/maven/org.jacoco/org.jacoco.core/pom.properties @@ -0,0 +1,3 @@ +artifactId=org.jacoco.core +groupId=org.jacoco +version=0.8.13 diff --git a/META-INF/maven/org.jacoco/org.jacoco.core/pom.xml b/META-INF/maven/org.jacoco/org.jacoco.core/pom.xml new file mode 100644 index 000000000..ec9a7b856 --- /dev/null +++ b/META-INF/maven/org.jacoco/org.jacoco.core/pom.xml @@ -0,0 +1,70 @@ + + + + 4.0.0 + + + org.jacoco + org.jacoco.build + 0.8.13 + ../org.jacoco.build + + + org.jacoco.core + + JaCoCo :: Core + JaCoCo Core + + + + org.ow2.asm + asm + + + org.ow2.asm + asm-commons + + + org.ow2.asm + asm-tree + + + + + src + + + + org.apache.felix + maven-bundle-plugin + + + process-classes + + manifest + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + ${project.build.outputDirectory}/META-INF/MANIFEST.MF + + + + + + diff --git a/about.html b/about.html new file mode 100644 index 000000000..7e9243309 --- /dev/null +++ b/about.html @@ -0,0 +1,72 @@ + + + + +About + + + +

About This Content

+ +

+ 2025/04/02 +

+ +

License

+ +

+ All Content in this distribution is made available by Mountainminds GmbH & Co. + KG, Munich. Unless otherwise indicated below, the Content is provided to you + under the terms and conditions of the Eclipse Public License Version 2.0 + ("EPL"). A copy of the EPL is available at + https://www.eclipse.org/legal/epl-2.0/. + For purposes of the EPL, "Program" will mean the Content. +

+ +

Third Party Content

+ +

+ The Content includes items that have been sourced from third parties as set + out below. +

+ +

ASM

+ +

+ ASM 9.8 is subject to the terms and + conditions of the following license: +

+ +
+ASM: a very small and fast Java bytecode manipulation framework
+Copyright (c) 2000-2011 INRIA, France Telecom
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the copyright holders nor the names of its
+   contributors may be used to endorse or promote products derived from
+   this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGE.
+
+ + + + diff --git a/cloudfoundry-resources/build.gradle.kts b/cloudfoundry-resources/build.gradle.kts index 3324504b5..f91c097eb 100644 --- a/cloudfoundry-resources/build.gradle.kts +++ b/cloudfoundry-resources/build.gradle.kts @@ -14,6 +14,8 @@ dependencies { compileOnly("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure-spi") compileOnly("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure") + compileOnly("com.google.auto.service:auto-service-annotations") + annotationProcessor("com.google.auto.service:auto-service") implementation("com.fasterxml.jackson.core:jackson-core") implementation("io.opentelemetry.semconv:opentelemetry-semconv") diff --git a/cloudfoundry-resources/src/main/java/io/opentelemetry/contrib/cloudfoundry/resources/CloudFoundryResource.java b/cloudfoundry-resources/src/main/java/io/opentelemetry/contrib/cloudfoundry/resources/CloudFoundryResource.java index 7d6313928..c8e7bd2f2 100644 --- a/cloudfoundry-resources/src/main/java/io/opentelemetry/contrib/cloudfoundry/resources/CloudFoundryResource.java +++ b/cloudfoundry-resources/src/main/java/io/opentelemetry/contrib/cloudfoundry/resources/CloudFoundryResource.java @@ -5,6 +5,8 @@ package io.opentelemetry.contrib.cloudfoundry.resources; +import static io.opentelemetry.api.common.AttributeKey.stringKey; + import com.fasterxml.jackson.core.JsonFactory; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonToken; @@ -22,24 +24,22 @@ public final class CloudFoundryResource { private static final String ENV_VCAP_APPLICATION = "VCAP_APPLICATION"; // copied from CloudfoundryIncubatingAttributes - private static final AttributeKey CLOUDFOUNDRY_APP_ID = - AttributeKey.stringKey("cloudfoundry.app.id"); + private static final AttributeKey CLOUDFOUNDRY_APP_ID = stringKey("cloudfoundry.app.id"); private static final AttributeKey CLOUDFOUNDRY_APP_INSTANCE_ID = - AttributeKey.stringKey("cloudfoundry.app.instance.id"); + stringKey("cloudfoundry.app.instance.id"); private static final AttributeKey CLOUDFOUNDRY_APP_NAME = - AttributeKey.stringKey("cloudfoundry.app.name"); - private static final AttributeKey CLOUDFOUNDRY_ORG_ID = - AttributeKey.stringKey("cloudfoundry.org.id"); + stringKey("cloudfoundry.app.name"); + private static final AttributeKey CLOUDFOUNDRY_ORG_ID = stringKey("cloudfoundry.org.id"); private static final AttributeKey CLOUDFOUNDRY_ORG_NAME = - AttributeKey.stringKey("cloudfoundry.org.name"); + stringKey("cloudfoundry.org.name"); private static final AttributeKey CLOUDFOUNDRY_PROCESS_ID = - AttributeKey.stringKey("cloudfoundry.process.id"); + stringKey("cloudfoundry.process.id"); private static final AttributeKey CLOUDFOUNDRY_PROCESS_TYPE = - AttributeKey.stringKey("cloudfoundry.process.type"); + stringKey("cloudfoundry.process.type"); private static final AttributeKey CLOUDFOUNDRY_SPACE_ID = - AttributeKey.stringKey("cloudfoundry.space.id"); + stringKey("cloudfoundry.space.id"); private static final AttributeKey CLOUDFOUNDRY_SPACE_NAME = - AttributeKey.stringKey("cloudfoundry.space.name"); + stringKey("cloudfoundry.space.name"); private static final Logger LOG = Logger.getLogger(CloudFoundryResource.class.getName()); private static final JsonFactory JSON_FACTORY = new JsonFactory(); private static final Resource INSTANCE = buildResource(System::getenv); diff --git a/cloudfoundry-resources/src/main/java/io/opentelemetry/contrib/cloudfoundry/resources/CloudFoundryResourceDetector.java b/cloudfoundry-resources/src/main/java/io/opentelemetry/contrib/cloudfoundry/resources/CloudFoundryResourceDetector.java index 02b9a6b09..3e727dfdc 100644 --- a/cloudfoundry-resources/src/main/java/io/opentelemetry/contrib/cloudfoundry/resources/CloudFoundryResourceDetector.java +++ b/cloudfoundry-resources/src/main/java/io/opentelemetry/contrib/cloudfoundry/resources/CloudFoundryResourceDetector.java @@ -5,11 +5,14 @@ package io.opentelemetry.contrib.cloudfoundry.resources; +import com.google.auto.service.AutoService; import io.opentelemetry.api.incubator.config.DeclarativeConfigProperties; import io.opentelemetry.sdk.autoconfigure.spi.internal.ComponentProvider; import io.opentelemetry.sdk.resources.Resource; -public class CloudFoundryResourceDetector implements ComponentProvider { +@SuppressWarnings("rawtypes") +@AutoService(ComponentProvider.class) +public final class CloudFoundryResourceDetector implements ComponentProvider { @Override public Class getType() { diff --git a/cloudfoundry-resources/src/main/java/io/opentelemetry/contrib/cloudfoundry/resources/CloudFoundryResourceProvider.java b/cloudfoundry-resources/src/main/java/io/opentelemetry/contrib/cloudfoundry/resources/CloudFoundryResourceProvider.java index e3f3e3c64..2119218db 100644 --- a/cloudfoundry-resources/src/main/java/io/opentelemetry/contrib/cloudfoundry/resources/CloudFoundryResourceProvider.java +++ b/cloudfoundry-resources/src/main/java/io/opentelemetry/contrib/cloudfoundry/resources/CloudFoundryResourceProvider.java @@ -5,11 +5,13 @@ package io.opentelemetry.contrib.cloudfoundry.resources; +import com.google.auto.service.AutoService; import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties; import io.opentelemetry.sdk.autoconfigure.spi.ResourceProvider; import io.opentelemetry.sdk.resources.Resource; -public class CloudFoundryResourceProvider implements ResourceProvider { +@AutoService(ResourceProvider.class) +public final class CloudFoundryResourceProvider implements ResourceProvider { @Override public Resource createResource(ConfigProperties configProperties) { diff --git a/cloudfoundry-resources/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.ResourceProvider b/cloudfoundry-resources/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.ResourceProvider deleted file mode 100644 index 0b0f252ca..000000000 --- a/cloudfoundry-resources/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.ResourceProvider +++ /dev/null @@ -1 +0,0 @@ -io.opentelemetry.contrib.cloudfoundry.resources.CloudFoundryResourceProvider diff --git a/cloudfoundry-resources/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.internal.ComponentProvider b/cloudfoundry-resources/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.internal.ComponentProvider deleted file mode 100644 index 96092ce3d..000000000 --- a/cloudfoundry-resources/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.internal.ComponentProvider +++ /dev/null @@ -1 +0,0 @@ -io.opentelemetry.contrib.cloudfoundry.resources.CloudFoundryResourceDetector diff --git a/cloudfoundry-resources/src/test/java/io/opentelemetry/contrib/cloudfoundry/resources/CloudFoundryResourceTest.java b/cloudfoundry-resources/src/test/java/io/opentelemetry/contrib/cloudfoundry/resources/CloudFoundryResourceTest.java index 1c533cd8a..28ff4b6df 100644 --- a/cloudfoundry-resources/src/test/java/io/opentelemetry/contrib/cloudfoundry/resources/CloudFoundryResourceTest.java +++ b/cloudfoundry-resources/src/test/java/io/opentelemetry/contrib/cloudfoundry/resources/CloudFoundryResourceTest.java @@ -5,7 +5,11 @@ package io.opentelemetry.contrib.cloudfoundry.resources; +import static java.nio.charset.StandardCharsets.UTF_8; +import static java.util.Collections.emptyMap; +import static java.util.stream.Collectors.joining; import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; import io.opentelemetry.sdk.resources.Resource; import io.opentelemetry.semconv.SchemaUrls; @@ -14,12 +18,8 @@ import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; -import java.nio.charset.StandardCharsets; -import java.util.Collections; import java.util.HashMap; import java.util.Map; -import java.util.stream.Collectors; -import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; class CloudFoundryResourceTest { @@ -34,20 +34,18 @@ private static String loadVcapApplicationSample(String filename) { try (InputStream is = CloudFoundryResourceTest.class.getClassLoader().getResourceAsStream(filename)) { if (is != null) { - return new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8)) - .lines() - .collect(Collectors.joining()); + return new BufferedReader(new InputStreamReader(is, UTF_8)).lines().collect(joining()); } - Assertions.fail("Cannot load resource " + filename); + fail("Cannot load resource " + filename); } catch (IOException e) { - Assertions.fail("Error reading " + filename); + fail("Error reading " + filename); } return ""; } @Test void noVcapApplication() { - Map env = Collections.emptyMap(); + Map env = emptyMap(); Resource resource = CloudFoundryResource.buildResource(env::get); assertThat(resource).isEqualTo(Resource.empty()); } diff --git a/org/jacoco/agent/rt/internal_0e20598/core/jacoco.properties b/org/jacoco/agent/rt/internal_0e20598/core/jacoco.properties new file mode 100644 index 000000000..533124f47 --- /dev/null +++ b/org/jacoco/agent/rt/internal_0e20598/core/jacoco.properties @@ -0,0 +1,4 @@ +VERSION=0.8.13.202504020838 +COMMITID=78d5eff856bbe6129f05012e40c13d1840e20598 +HOMEURL=http://www.jacoco.org/jacoco +RUNTIMEPACKAGE=org.jacoco.agent.rt.internal_0e20598 From b11c7f48a8e9431d3aeae4693b6497bfc08c6ac8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 24 Aug 2025 20:01:32 +0000 Subject: [PATCH 17/48] Clean up accidentally committed temporary files Co-authored-by: trask <218610+trask@users.noreply.github.com> --- META-INF/MANIFEST.MF | 10 -- .../org.jacoco.agent.rt/pom.properties | 3 - .../org.jacoco/org.jacoco.agent.rt/pom.xml | 109 ------------------ .../org.jacoco/org.jacoco.core/pom.properties | 3 - .../maven/org.jacoco/org.jacoco.core/pom.xml | 70 ----------- about.html | 72 ------------ .../internal_0e20598/core/jacoco.properties | 4 - 7 files changed, 271 deletions(-) delete mode 100644 META-INF/MANIFEST.MF delete mode 100644 META-INF/maven/org.jacoco/org.jacoco.agent.rt/pom.properties delete mode 100644 META-INF/maven/org.jacoco/org.jacoco.agent.rt/pom.xml delete mode 100644 META-INF/maven/org.jacoco/org.jacoco.core/pom.properties delete mode 100644 META-INF/maven/org.jacoco/org.jacoco.core/pom.xml delete mode 100644 about.html delete mode 100644 org/jacoco/agent/rt/internal_0e20598/core/jacoco.properties diff --git a/META-INF/MANIFEST.MF b/META-INF/MANIFEST.MF deleted file mode 100644 index 25cbb4c73..000000000 --- a/META-INF/MANIFEST.MF +++ /dev/null @@ -1,10 +0,0 @@ -Manifest-Version: 1.0 -Created-By: Maven JAR Plugin 3.4.2 -Build-Jdk-Spec: 1.5 -Build-Tool-Jdk-Spec: 21 -Automatic-Module-Name: org.jacoco.agent.rt -Implementation-Title: JaCoCo Java Agent -Implementation-Vendor: Mountainminds GmbH & Co. KG -Implementation-Version: 0.8.13 -Premain-Class: org.jacoco.agent.rt.internal_0e20598.PreMain - diff --git a/META-INF/maven/org.jacoco/org.jacoco.agent.rt/pom.properties b/META-INF/maven/org.jacoco/org.jacoco.agent.rt/pom.properties deleted file mode 100644 index 418f8f60f..000000000 --- a/META-INF/maven/org.jacoco/org.jacoco.agent.rt/pom.properties +++ /dev/null @@ -1,3 +0,0 @@ -artifactId=org.jacoco.agent.rt -groupId=org.jacoco -version=0.8.13 diff --git a/META-INF/maven/org.jacoco/org.jacoco.agent.rt/pom.xml b/META-INF/maven/org.jacoco/org.jacoco.agent.rt/pom.xml deleted file mode 100644 index 8de9b8e89..000000000 --- a/META-INF/maven/org.jacoco/org.jacoco.agent.rt/pom.xml +++ /dev/null @@ -1,109 +0,0 @@ - - - - 4.0.0 - - - org.jacoco - org.jacoco.build - 0.8.13 - ../org.jacoco.build - - - org.jacoco.agent.rt - - - JaCoCo :: Agent RT - JaCoCo Java Agent - - - true - true - - - - - ${project.groupId} - org.jacoco.core - - - - - src - - - - org.apache.maven.plugins - maven-shade-plugin - - - package - - shade - - - true - all - true - - - org.jacoco.agent.rt.internal - ${jacoco.runtime.package.name} - - - org.jacoco.core - ${jacoco.runtime.package.name}.core - - - org.objectweb.asm - ${jacoco.runtime.package.name}.asm - - - - - *:* - - META-INF/MANIFEST.MF - - - - org.jacoco:org.jacoco.core - - about.html - - - - org.ow2.asm:* - - module-info.class - - - - - - - ${jacoco.runtime.package.name}.PreMain - ${project.artifactId} - ${project.description} - ${project.organization.name} - ${project.version} - - - - - - - - - - diff --git a/META-INF/maven/org.jacoco/org.jacoco.core/pom.properties b/META-INF/maven/org.jacoco/org.jacoco.core/pom.properties deleted file mode 100644 index 0bf485135..000000000 --- a/META-INF/maven/org.jacoco/org.jacoco.core/pom.properties +++ /dev/null @@ -1,3 +0,0 @@ -artifactId=org.jacoco.core -groupId=org.jacoco -version=0.8.13 diff --git a/META-INF/maven/org.jacoco/org.jacoco.core/pom.xml b/META-INF/maven/org.jacoco/org.jacoco.core/pom.xml deleted file mode 100644 index ec9a7b856..000000000 --- a/META-INF/maven/org.jacoco/org.jacoco.core/pom.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - 4.0.0 - - - org.jacoco - org.jacoco.build - 0.8.13 - ../org.jacoco.build - - - org.jacoco.core - - JaCoCo :: Core - JaCoCo Core - - - - org.ow2.asm - asm - - - org.ow2.asm - asm-commons - - - org.ow2.asm - asm-tree - - - - - src - - - - org.apache.felix - maven-bundle-plugin - - - process-classes - - manifest - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - ${project.build.outputDirectory}/META-INF/MANIFEST.MF - - - - - - diff --git a/about.html b/about.html deleted file mode 100644 index 7e9243309..000000000 --- a/about.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - -About - - - -

About This Content

- -

- 2025/04/02 -

- -

License

- -

- All Content in this distribution is made available by Mountainminds GmbH & Co. - KG, Munich. Unless otherwise indicated below, the Content is provided to you - under the terms and conditions of the Eclipse Public License Version 2.0 - ("EPL"). A copy of the EPL is available at - https://www.eclipse.org/legal/epl-2.0/. - For purposes of the EPL, "Program" will mean the Content. -

- -

Third Party Content

- -

- The Content includes items that have been sourced from third parties as set - out below. -

- -

ASM

- -

- ASM 9.8 is subject to the terms and - conditions of the following license: -

- -
-ASM: a very small and fast Java bytecode manipulation framework
-Copyright (c) 2000-2011 INRIA, France Telecom
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-1. Redistributions of source code must retain the above copyright
-   notice, this list of conditions and the following disclaimer.
-2. Redistributions in binary form must reproduce the above copyright
-   notice, this list of conditions and the following disclaimer in the
-   documentation and/or other materials provided with the distribution.
-3. Neither the name of the copyright holders nor the names of its
-   contributors may be used to endorse or promote products derived from
-   this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGE.
-
- - - - diff --git a/org/jacoco/agent/rt/internal_0e20598/core/jacoco.properties b/org/jacoco/agent/rt/internal_0e20598/core/jacoco.properties deleted file mode 100644 index 533124f47..000000000 --- a/org/jacoco/agent/rt/internal_0e20598/core/jacoco.properties +++ /dev/null @@ -1,4 +0,0 @@ -VERSION=0.8.13.202504020838 -COMMITID=78d5eff856bbe6129f05012e40c13d1840e20598 -HOMEURL=http://www.jacoco.org/jacoco -RUNTIMEPACKAGE=org.jacoco.agent.rt.internal_0e20598 From 941b89d42b3362a8336c3319ceba03299ec0e871 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 24 Aug 2025 20:01:48 +0000 Subject: [PATCH 18/48] Update aws-resources module to follow style guide: add @AutoService annotations Co-authored-by: trask <218610+trask@users.noreply.github.com> --- aws-resources/build.gradle.kts | 4 ++++ .../contrib/aws/resource/BeanstalkResourceProvider.java | 2 ++ .../contrib/aws/resource/Ec2ResourceProvider.java | 2 ++ .../contrib/aws/resource/EcsResourceProvider.java | 2 ++ .../contrib/aws/resource/EksResourceProvider.java | 2 ++ .../contrib/aws/resource/LambdaResourceProvider.java | 2 ++ .../contrib/aws/resource/internal/AwsResourceDetector.java | 5 ++++- .../io.opentelemetry.sdk.autoconfigure.spi.ResourceProvider | 5 ----- ...elemetry.sdk.autoconfigure.spi.internal.ComponentProvider | 1 - 9 files changed, 18 insertions(+), 7 deletions(-) delete mode 100644 aws-resources/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.ResourceProvider delete mode 100644 aws-resources/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.internal.ComponentProvider diff --git a/aws-resources/build.gradle.kts b/aws-resources/build.gradle.kts index 580ecb44f..edc76a4db 100644 --- a/aws-resources/build.gradle.kts +++ b/aws-resources/build.gradle.kts @@ -8,6 +8,8 @@ description = "OpenTelemetry AWS Resources Support" otelJava.moduleName.set("io.opentelemetry.contrib.aws.resource") dependencies { + annotationProcessor("com.google.auto.service:auto-service") + api("io.opentelemetry:opentelemetry-api") compileOnly("io.opentelemetry:opentelemetry-api-incubator") api("io.opentelemetry:opentelemetry-sdk") @@ -16,6 +18,7 @@ dependencies { testImplementation("io.opentelemetry.semconv:opentelemetry-semconv-incubating") compileOnly("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure") + compileOnly("com.google.auto.service:auto-service") implementation("com.fasterxml.jackson.core:jackson-core") implementation("com.squareup.okhttp3:okhttp") @@ -23,6 +26,7 @@ dependencies { testImplementation("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure") testImplementation("io.opentelemetry:opentelemetry-api-incubator") testImplementation("io.opentelemetry:opentelemetry-sdk-testing") + testImplementation("com.google.auto.service:auto-service") testImplementation("com.linecorp.armeria:armeria-junit5") testRuntimeOnly("org.bouncycastle:bcpkix-jdk15on") diff --git a/aws-resources/src/main/java/io/opentelemetry/contrib/aws/resource/BeanstalkResourceProvider.java b/aws-resources/src/main/java/io/opentelemetry/contrib/aws/resource/BeanstalkResourceProvider.java index 258c4ad21..8ba8b3fa0 100644 --- a/aws-resources/src/main/java/io/opentelemetry/contrib/aws/resource/BeanstalkResourceProvider.java +++ b/aws-resources/src/main/java/io/opentelemetry/contrib/aws/resource/BeanstalkResourceProvider.java @@ -5,11 +5,13 @@ package io.opentelemetry.contrib.aws.resource; +import com.google.auto.service.AutoService; import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties; import io.opentelemetry.sdk.autoconfigure.spi.ResourceProvider; import io.opentelemetry.sdk.resources.Resource; /** {@link ResourceProvider} for automatically configuring {@link BeanstalkResource}. */ +@AutoService(ResourceProvider.class) public final class BeanstalkResourceProvider extends CloudResourceProvider { @Override public Resource createResource(ConfigProperties config) { diff --git a/aws-resources/src/main/java/io/opentelemetry/contrib/aws/resource/Ec2ResourceProvider.java b/aws-resources/src/main/java/io/opentelemetry/contrib/aws/resource/Ec2ResourceProvider.java index b8378aad5..fdf39a298 100644 --- a/aws-resources/src/main/java/io/opentelemetry/contrib/aws/resource/Ec2ResourceProvider.java +++ b/aws-resources/src/main/java/io/opentelemetry/contrib/aws/resource/Ec2ResourceProvider.java @@ -5,11 +5,13 @@ package io.opentelemetry.contrib.aws.resource; +import com.google.auto.service.AutoService; import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties; import io.opentelemetry.sdk.autoconfigure.spi.ResourceProvider; import io.opentelemetry.sdk.resources.Resource; /** {@link ResourceProvider} for automatically configuring {@link Ec2Resource}. */ +@AutoService(ResourceProvider.class) public final class Ec2ResourceProvider extends CloudResourceProvider { @Override public Resource createResource(ConfigProperties config) { diff --git a/aws-resources/src/main/java/io/opentelemetry/contrib/aws/resource/EcsResourceProvider.java b/aws-resources/src/main/java/io/opentelemetry/contrib/aws/resource/EcsResourceProvider.java index cde8836ab..46c417436 100644 --- a/aws-resources/src/main/java/io/opentelemetry/contrib/aws/resource/EcsResourceProvider.java +++ b/aws-resources/src/main/java/io/opentelemetry/contrib/aws/resource/EcsResourceProvider.java @@ -5,11 +5,13 @@ package io.opentelemetry.contrib.aws.resource; +import com.google.auto.service.AutoService; import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties; import io.opentelemetry.sdk.autoconfigure.spi.ResourceProvider; import io.opentelemetry.sdk.resources.Resource; /** {@link ResourceProvider} for automatically configuring {@link EcsResource}. */ +@AutoService(ResourceProvider.class) public final class EcsResourceProvider extends CloudResourceProvider { @Override public Resource createResource(ConfigProperties config) { diff --git a/aws-resources/src/main/java/io/opentelemetry/contrib/aws/resource/EksResourceProvider.java b/aws-resources/src/main/java/io/opentelemetry/contrib/aws/resource/EksResourceProvider.java index 153277680..2ef96f1a4 100644 --- a/aws-resources/src/main/java/io/opentelemetry/contrib/aws/resource/EksResourceProvider.java +++ b/aws-resources/src/main/java/io/opentelemetry/contrib/aws/resource/EksResourceProvider.java @@ -5,11 +5,13 @@ package io.opentelemetry.contrib.aws.resource; +import com.google.auto.service.AutoService; import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties; import io.opentelemetry.sdk.autoconfigure.spi.ResourceProvider; import io.opentelemetry.sdk.resources.Resource; /** {@link ResourceProvider} for automatically configuring {@link EksResource}. */ +@AutoService(ResourceProvider.class) public final class EksResourceProvider extends CloudResourceProvider { @Override public Resource createResource(ConfigProperties config) { diff --git a/aws-resources/src/main/java/io/opentelemetry/contrib/aws/resource/LambdaResourceProvider.java b/aws-resources/src/main/java/io/opentelemetry/contrib/aws/resource/LambdaResourceProvider.java index 71743ee26..8c31dc5ce 100644 --- a/aws-resources/src/main/java/io/opentelemetry/contrib/aws/resource/LambdaResourceProvider.java +++ b/aws-resources/src/main/java/io/opentelemetry/contrib/aws/resource/LambdaResourceProvider.java @@ -5,11 +5,13 @@ package io.opentelemetry.contrib.aws.resource; +import com.google.auto.service.AutoService; import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties; import io.opentelemetry.sdk.autoconfigure.spi.ResourceProvider; import io.opentelemetry.sdk.resources.Resource; /** {@link ResourceProvider} for automatically configuring {@link LambdaResource}. */ +@AutoService(ResourceProvider.class) public final class LambdaResourceProvider extends CloudResourceProvider { @Override public Resource createResource(ConfigProperties config) { diff --git a/aws-resources/src/main/java/io/opentelemetry/contrib/aws/resource/internal/AwsResourceDetector.java b/aws-resources/src/main/java/io/opentelemetry/contrib/aws/resource/internal/AwsResourceDetector.java index ae4255570..a72957dd7 100644 --- a/aws-resources/src/main/java/io/opentelemetry/contrib/aws/resource/internal/AwsResourceDetector.java +++ b/aws-resources/src/main/java/io/opentelemetry/contrib/aws/resource/internal/AwsResourceDetector.java @@ -5,6 +5,7 @@ package io.opentelemetry.contrib.aws.resource.internal; +import com.google.auto.service.AutoService; import io.opentelemetry.api.incubator.config.DeclarativeConfigProperties; import io.opentelemetry.contrib.aws.resource.BeanstalkResource; import io.opentelemetry.contrib.aws.resource.Ec2Resource; @@ -15,7 +16,9 @@ import io.opentelemetry.sdk.resources.Resource; import io.opentelemetry.sdk.resources.ResourceBuilder; -public class AwsResourceDetector implements ComponentProvider { +@AutoService(ComponentProvider.class) +@SuppressWarnings("rawtypes") +public final class AwsResourceDetector implements ComponentProvider { @Override public Class getType() { diff --git a/aws-resources/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.ResourceProvider b/aws-resources/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.ResourceProvider deleted file mode 100644 index e581f09d7..000000000 --- a/aws-resources/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.ResourceProvider +++ /dev/null @@ -1,5 +0,0 @@ -io.opentelemetry.contrib.aws.resource.BeanstalkResourceProvider -io.opentelemetry.contrib.aws.resource.Ec2ResourceProvider -io.opentelemetry.contrib.aws.resource.EcsResourceProvider -io.opentelemetry.contrib.aws.resource.EksResourceProvider -io.opentelemetry.contrib.aws.resource.LambdaResourceProvider diff --git a/aws-resources/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.internal.ComponentProvider b/aws-resources/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.internal.ComponentProvider deleted file mode 100644 index ea6d743f4..000000000 --- a/aws-resources/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.internal.ComponentProvider +++ /dev/null @@ -1 +0,0 @@ -io.opentelemetry.contrib.aws.resource.internal.AwsResourceDetector From c8f017aa12fb96fce65c02636405d0737356efb6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 24 Aug 2025 20:02:29 +0000 Subject: [PATCH 19/48] Initial plan From 0b1f72d3e17d559e8192b65639ca638017897bb5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 24 Aug 2025 20:04:31 +0000 Subject: [PATCH 20/48] Initial plan From e9f658218677c6046b2fe5d31946e7d0465383b0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 24 Aug 2025 20:04:45 +0000 Subject: [PATCH 21/48] Changes before error encountered Co-authored-by: trask <218610+trask@users.noreply.github.com> --- .../io/opentelemetry/contrib/awsxray/AwsAttributeKeys.java | 4 ++-- .../opentelemetry/contrib/awsxray/AwsXrayRemoteSampler.java | 3 ++- .../io/opentelemetry/contrib/awsxray/XrayRulesSampler.java | 4 +++- .../io/opentelemetry/contrib/awsxray/ResourceHolderTest.java | 2 +- .../opentelemetry/contrib/awsxray/XrayRulesSamplerTest.java | 4 ++-- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AwsAttributeKeys.java b/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AwsAttributeKeys.java index c9e762d63..49c75bce3 100644 --- a/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AwsAttributeKeys.java +++ b/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AwsAttributeKeys.java @@ -12,8 +12,6 @@ /** Utility class holding attribute keys with special meaning to AWS components */ final class AwsAttributeKeys { - private AwsAttributeKeys() {} - static final AttributeKey AWS_SPAN_KIND = stringKey("aws.span.kind"); static final AttributeKey AWS_LOCAL_SERVICE = stringKey("aws.local.service"); @@ -35,4 +33,6 @@ private AwsAttributeKeys() {} static final AttributeKey AWS_QUEUE_NAME = stringKey("aws.queue.name"); static final AttributeKey AWS_STREAM_NAME = stringKey("aws.stream.name"); static final AttributeKey AWS_TABLE_NAME = stringKey("aws.table.name"); + + private AwsAttributeKeys() {} } diff --git a/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AwsXrayRemoteSampler.java b/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AwsXrayRemoteSampler.java index 8b9e18182..45bcb3b72 100644 --- a/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AwsXrayRemoteSampler.java +++ b/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AwsXrayRemoteSampler.java @@ -7,6 +7,7 @@ import static java.util.concurrent.TimeUnit.NANOSECONDS; import static java.util.concurrent.TimeUnit.SECONDS; +import static java.util.logging.FINE; import static java.util.stream.Collectors.toList; import static java.util.stream.Collectors.toMap; import static java.util.stream.Collectors.toSet; @@ -149,7 +150,7 @@ private void getAndUpdateSampler() { executor.schedule(this::fetchTargets, DEFAULT_TARGET_INTERVAL_NANOS, NANOSECONDS); } } catch (Throwable t) { - logger.log(Level.FINE, "Failed to update sampler", t); + logger.log(FINE, "Failed to update sampler", t); } scheduleSamplerUpdate(); } diff --git a/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/XrayRulesSampler.java b/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/XrayRulesSampler.java index 75977dc0f..ce8e54aba 100644 --- a/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/XrayRulesSampler.java +++ b/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/XrayRulesSampler.java @@ -5,6 +5,8 @@ package io.opentelemetry.contrib.awsxray; +import static java.util.logging.Level.FINE; + import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.trace.SpanKind; import io.opentelemetry.context.Context; @@ -84,7 +86,7 @@ public SamplingResult shouldSample( // In practice, X-Ray always returns a Default rule that matches all requests so it is a bug in // our code or X-Ray to reach here, fallback just in case. logger.log( - Level.FINE, + FINE, "No sampling rule matched the request. " + "This is a bug in either the OpenTelemetry SDK or X-Ray."); return fallbackSampler.shouldSample( diff --git a/aws-xray/src/test/java/io/opentelemetry/contrib/awsxray/ResourceHolderTest.java b/aws-xray/src/test/java/io/opentelemetry/contrib/awsxray/ResourceHolderTest.java index 1140abc5f..e139db578 100644 --- a/aws-xray/src/test/java/io/opentelemetry/contrib/awsxray/ResourceHolderTest.java +++ b/aws-xray/src/test/java/io/opentelemetry/contrib/awsxray/ResourceHolderTest.java @@ -21,7 +21,7 @@ * Unit tests for {@link ResourceHolder}. Note that there isn't a great way to test the "default" * fallback logic, as when the test suite is run, the customize logic appears to be invoked. */ -public class ResourceHolderTest { +class ResourceHolderTest { @Test @SuppressWarnings("unchecked") diff --git a/aws-xray/src/test/java/io/opentelemetry/contrib/awsxray/XrayRulesSamplerTest.java b/aws-xray/src/test/java/io/opentelemetry/contrib/awsxray/XrayRulesSamplerTest.java index 1ca8df347..3f1ab9167 100644 --- a/aws-xray/src/test/java/io/opentelemetry/contrib/awsxray/XrayRulesSamplerTest.java +++ b/aws-xray/src/test/java/io/opentelemetry/contrib/awsxray/XrayRulesSamplerTest.java @@ -5,9 +5,9 @@ package io.opentelemetry.contrib.awsxray; +import static io.opentelemetry.api.common.AttributeKey.stringKey; import static org.assertj.core.api.Assertions.assertThat; -import io.opentelemetry.api.common.AttributeKey; import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.trace.SpanKind; import io.opentelemetry.api.trace.TraceId; @@ -175,7 +175,7 @@ private static SamplingResult doSample(Sampler sampler, String name) { TraceId.fromLongs(1, 2), name, SpanKind.CLIENT, - Attributes.of(AttributeKey.stringKey("test"), name), + Attributes.of(stringKey("test"), name), Collections.emptyList()); } } From 506e1aa757601e85e7b169ede3e797390f1ca7da Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 24 Aug 2025 20:04:55 +0000 Subject: [PATCH 22/48] Changes before error encountered Co-authored-by: trask <218610+trask@users.noreply.github.com> --- gcp-resources/build.gradle.kts | 3 +++ .../contrib/gcp/resource/GCPResourceProvider.java | 4 +++- .../contrib/gcp/resource/internal/GcpResourceDetector.java | 2 ++ .../io.opentelemetry.sdk.autoconfigure.spi.ResourceProvider | 1 - ...telemetry.sdk.autoconfigure.spi.internal.ComponentProvider | 1 - 5 files changed, 8 insertions(+), 3 deletions(-) delete mode 100644 gcp-resources/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.ResourceProvider delete mode 100644 gcp-resources/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.internal.ComponentProvider diff --git a/gcp-resources/build.gradle.kts b/gcp-resources/build.gradle.kts index cc227ed6e..bbc68e9e1 100644 --- a/gcp-resources/build.gradle.kts +++ b/gcp-resources/build.gradle.kts @@ -18,6 +18,7 @@ dependencies { testImplementation("io.opentelemetry.semconv:opentelemetry-semconv-incubating") compileOnly("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure") + compileOnly("com.google.auto.service:auto-service-annotations") implementation("com.fasterxml.jackson.core:jackson-core") @@ -29,4 +30,6 @@ dependencies { testImplementation("com.google.guava:guava") testImplementation("org.junit.jupiter:junit-jupiter-api") + + annotationProcessor("com.google.auto.service:auto-service") } diff --git a/gcp-resources/src/main/java/io/opentelemetry/contrib/gcp/resource/GCPResourceProvider.java b/gcp-resources/src/main/java/io/opentelemetry/contrib/gcp/resource/GCPResourceProvider.java index b7e49c1a9..f1bd5b0bd 100644 --- a/gcp-resources/src/main/java/io/opentelemetry/contrib/gcp/resource/GCPResourceProvider.java +++ b/gcp-resources/src/main/java/io/opentelemetry/contrib/gcp/resource/GCPResourceProvider.java @@ -50,6 +50,7 @@ import static io.opentelemetry.contrib.gcp.resource.IncubatingAttributes.HOST_TYPE; import static io.opentelemetry.contrib.gcp.resource.IncubatingAttributes.K8S_CLUSTER_NAME; +import com.google.auto.service.AutoService; import com.google.cloud.opentelemetry.detection.DetectedPlatform; import com.google.cloud.opentelemetry.detection.GCPPlatformDetector; import io.opentelemetry.api.common.Attributes; @@ -62,7 +63,8 @@ import java.util.logging.Logger; @SuppressWarnings("MemberName") -public class GCPResourceProvider implements ConditionalResourceProvider { +@AutoService(ConditionalResourceProvider.class) +public final class GCPResourceProvider implements ConditionalResourceProvider { private static final Logger LOGGER = Logger.getLogger(GCPResourceProvider.class.getSimpleName()); private final GCPPlatformDetector detector; diff --git a/gcp-resources/src/main/java/io/opentelemetry/contrib/gcp/resource/internal/GcpResourceDetector.java b/gcp-resources/src/main/java/io/opentelemetry/contrib/gcp/resource/internal/GcpResourceDetector.java index 35adbeded..d19775f80 100644 --- a/gcp-resources/src/main/java/io/opentelemetry/contrib/gcp/resource/internal/GcpResourceDetector.java +++ b/gcp-resources/src/main/java/io/opentelemetry/contrib/gcp/resource/internal/GcpResourceDetector.java @@ -5,12 +5,14 @@ package io.opentelemetry.contrib.gcp.resource.internal; +import com.google.auto.service.AutoService; import io.opentelemetry.api.incubator.config.DeclarativeConfigProperties; import io.opentelemetry.contrib.gcp.resource.GCPResourceProvider; import io.opentelemetry.sdk.autoconfigure.spi.internal.ComponentProvider; import io.opentelemetry.sdk.resources.Resource; import io.opentelemetry.sdk.resources.ResourceBuilder; +@AutoService(ComponentProvider.class) public class GcpResourceDetector implements ComponentProvider { @Override diff --git a/gcp-resources/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.ResourceProvider b/gcp-resources/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.ResourceProvider deleted file mode 100644 index d65134276..000000000 --- a/gcp-resources/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.ResourceProvider +++ /dev/null @@ -1 +0,0 @@ -io.opentelemetry.contrib.gcp.resource.GCPResourceProvider diff --git a/gcp-resources/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.internal.ComponentProvider b/gcp-resources/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.internal.ComponentProvider deleted file mode 100644 index e65bbc840..000000000 --- a/gcp-resources/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.internal.ComponentProvider +++ /dev/null @@ -1 +0,0 @@ -io.opentelemetry.contrib.gcp.resource.internal.GcpResourceDetector From 11f6928556113976deb3ad08c27b36ba5c9c375f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 24 Aug 2025 20:04:59 +0000 Subject: [PATCH 23/48] Changes before error encountered Co-authored-by: trask <218610+trask@users.noreply.github.com> --- .../contrib/disk/buffering/LogRecordFromDiskExporter.java | 2 +- .../contrib/disk/buffering/LogRecordToDiskExporter.java | 2 +- .../contrib/disk/buffering/MetricToDiskExporter.java | 2 +- .../contrib/disk/buffering/SpanToDiskExporter.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/disk-buffering/src/main/java/io/opentelemetry/contrib/disk/buffering/LogRecordFromDiskExporter.java b/disk-buffering/src/main/java/io/opentelemetry/contrib/disk/buffering/LogRecordFromDiskExporter.java index c26a383d6..6c38be04a 100644 --- a/disk-buffering/src/main/java/io/opentelemetry/contrib/disk/buffering/LogRecordFromDiskExporter.java +++ b/disk-buffering/src/main/java/io/opentelemetry/contrib/disk/buffering/LogRecordFromDiskExporter.java @@ -14,7 +14,7 @@ import java.io.IOException; import java.util.concurrent.TimeUnit; -public class LogRecordFromDiskExporter implements FromDiskExporter { +public final class LogRecordFromDiskExporter implements FromDiskExporter { private final FromDiskExporterImpl delegate; diff --git a/disk-buffering/src/main/java/io/opentelemetry/contrib/disk/buffering/LogRecordToDiskExporter.java b/disk-buffering/src/main/java/io/opentelemetry/contrib/disk/buffering/LogRecordToDiskExporter.java index 665e90f76..aa64d61ac 100644 --- a/disk-buffering/src/main/java/io/opentelemetry/contrib/disk/buffering/LogRecordToDiskExporter.java +++ b/disk-buffering/src/main/java/io/opentelemetry/contrib/disk/buffering/LogRecordToDiskExporter.java @@ -18,7 +18,7 @@ * This class implements a {@link LogRecordExporter} that delegates to an instance of {@code * ToDiskExporter}. */ -public class LogRecordToDiskExporter implements LogRecordExporter { +public final class LogRecordToDiskExporter implements LogRecordExporter { private final ToDiskExporter delegate; /** diff --git a/disk-buffering/src/main/java/io/opentelemetry/contrib/disk/buffering/MetricToDiskExporter.java b/disk-buffering/src/main/java/io/opentelemetry/contrib/disk/buffering/MetricToDiskExporter.java index 83d2fc73c..2e0848684 100644 --- a/disk-buffering/src/main/java/io/opentelemetry/contrib/disk/buffering/MetricToDiskExporter.java +++ b/disk-buffering/src/main/java/io/opentelemetry/contrib/disk/buffering/MetricToDiskExporter.java @@ -21,7 +21,7 @@ * This class implements a {@link MetricExporter} that delegates to an instance of {@code * ToDiskExporter}. */ -public class MetricToDiskExporter implements MetricExporter { +public final class MetricToDiskExporter implements MetricExporter { private final ToDiskExporter delegate; private final AggregationTemporalitySelector aggregationTemporalitySelector; diff --git a/disk-buffering/src/main/java/io/opentelemetry/contrib/disk/buffering/SpanToDiskExporter.java b/disk-buffering/src/main/java/io/opentelemetry/contrib/disk/buffering/SpanToDiskExporter.java index d5ca81518..dcd79d3b0 100644 --- a/disk-buffering/src/main/java/io/opentelemetry/contrib/disk/buffering/SpanToDiskExporter.java +++ b/disk-buffering/src/main/java/io/opentelemetry/contrib/disk/buffering/SpanToDiskExporter.java @@ -18,7 +18,7 @@ * This class implements a SpanExporter that delegates to an instance of {@code * ToDiskExporter}. */ -public class SpanToDiskExporter implements SpanExporter { +public final class SpanToDiskExporter implements SpanExporter { private final ToDiskExporter delegate; From 2cfe17ecf95ed54e96ee4ca35ce266c15a3deac8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 24 Aug 2025 20:06:34 +0000 Subject: [PATCH 24/48] Initial plan From 4f29d6feb3cd8df5025a7467852f3329a3990f29 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 24 Aug 2025 20:07:14 +0000 Subject: [PATCH 25/48] Changes before error encountered Co-authored-by: trask <218610+trask@users.noreply.github.com> --- ...thAutoConfigurationCustomizerProvider.java | 22 +++++++++++-------- .../contrib/gcp/auth/GoogleAuthException.java | 2 +- .../auth/GcpAuthExtensionEndToEndTest.java | 2 +- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/gcp-auth-extension/src/main/java/io/opentelemetry/contrib/gcp/auth/GcpAuthAutoConfigurationCustomizerProvider.java b/gcp-auth-extension/src/main/java/io/opentelemetry/contrib/gcp/auth/GcpAuthAutoConfigurationCustomizerProvider.java index 1de583029..5d96d8f35 100644 --- a/gcp-auth-extension/src/main/java/io/opentelemetry/contrib/gcp/auth/GcpAuthAutoConfigurationCustomizerProvider.java +++ b/gcp-auth-extension/src/main/java/io/opentelemetry/contrib/gcp/auth/GcpAuthAutoConfigurationCustomizerProvider.java @@ -5,6 +5,12 @@ package io.opentelemetry.contrib.gcp.auth; +import static java.util.Arrays.stream; +import static java.util.Objects.requireNonNull; +import static java.util.logging.Level.WARNING; +import static java.util.stream.Collectors.joining; +import static java.util.stream.Collectors.toMap; + import com.google.auth.oauth2.GoogleCredentials; import com.google.auto.service.AutoService; import io.opentelemetry.api.common.AttributeKey; @@ -25,14 +31,11 @@ import io.opentelemetry.sdk.resources.Resource; import io.opentelemetry.sdk.trace.export.SpanExporter; import java.io.IOException; -import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; -import java.util.logging.Level; import java.util.logging.Logger; -import java.util.stream.Collectors; import javax.annotation.Nonnull; /** @@ -49,7 +52,7 @@ * @see GoogleCredentials */ @AutoService(AutoConfigurationCustomizerProvider.class) -public class GcpAuthAutoConfigurationCustomizerProvider +public final class GcpAuthAutoConfigurationCustomizerProvider implements AutoConfigurationCustomizerProvider { private static final Logger logger = @@ -96,6 +99,7 @@ public class GcpAuthAutoConfigurationCustomizerProvider */ @Override public void customize(@Nonnull AutoConfigurationCustomizer autoConfiguration) { + requireNonNull(autoConfiguration, "autoConfiguration"); GoogleCredentials credentials; try { credentials = GoogleCredentials.getApplicationDefault(); @@ -124,7 +128,7 @@ private static SpanExporter customizeSpanExporter( } else { String[] params = {SIGNAL_TYPE_TRACES, SIGNAL_TARGET_WARNING_FIX_SUGGESTION}; logger.log( - Level.WARNING, + WARNING, "GCP Authentication Extension is not configured for signal type: {0}. {1}", params); } @@ -138,7 +142,7 @@ private static MetricExporter customizeMetricExporter( } else { String[] params = {SIGNAL_TYPE_METRICS, SIGNAL_TARGET_WARNING_FIX_SUGGESTION}; logger.log( - Level.WARNING, + WARNING, "GCP Authentication Extension is not configured for signal type: {0}. {1}", params); } @@ -150,7 +154,7 @@ private static boolean isSignalTargeted(String checkSignal, ConfigProperties con String userSpecifiedTargetedSignals = ConfigurableOption.GOOGLE_OTEL_AUTH_TARGET_SIGNALS.getConfiguredValueWithFallback( configProperties, () -> SIGNAL_TYPE_ALL); - return Arrays.stream(userSpecifiedTargetedSignals.split(",")) + return stream(userSpecifiedTargetedSignals.split(",")) .map(String::trim) .anyMatch( targetedSignal -> @@ -206,13 +210,13 @@ private static Map getRequiredHeaderMap( Map flattenedHeaders = gcpHeaders.entrySet().stream() .collect( - Collectors.toMap( + toMap( Map.Entry::getKey, entry -> entry.getValue().stream() .filter(Objects::nonNull) // Filter nulls .filter(s -> !s.isEmpty()) // Filter empty strings - .collect(Collectors.joining(",")))); + .collect(joining(",")))); // Add quota user project header if not detected by the auth library and user provided it via // system properties. if (!flattenedHeaders.containsKey(QUOTA_USER_PROJECT_HEADER)) { diff --git a/gcp-auth-extension/src/main/java/io/opentelemetry/contrib/gcp/auth/GoogleAuthException.java b/gcp-auth-extension/src/main/java/io/opentelemetry/contrib/gcp/auth/GoogleAuthException.java index 2f6335f52..d7913a94f 100644 --- a/gcp-auth-extension/src/main/java/io/opentelemetry/contrib/gcp/auth/GoogleAuthException.java +++ b/gcp-auth-extension/src/main/java/io/opentelemetry/contrib/gcp/auth/GoogleAuthException.java @@ -10,7 +10,7 @@ * thrown when there are issues with retrieving or refreshing Google Application Default Credentials * (ADC). */ -public class GoogleAuthException extends RuntimeException { +public final class GoogleAuthException extends RuntimeException { private static final long serialVersionUID = 149908685226796448L; diff --git a/gcp-auth-extension/src/test/java/io/opentelemetry/contrib/gcp/auth/GcpAuthExtensionEndToEndTest.java b/gcp-auth-extension/src/test/java/io/opentelemetry/contrib/gcp/auth/GcpAuthExtensionEndToEndTest.java index e04baed93..543dfb6d6 100644 --- a/gcp-auth-extension/src/test/java/io/opentelemetry/contrib/gcp/auth/GcpAuthExtensionEndToEndTest.java +++ b/gcp-auth-extension/src/test/java/io/opentelemetry/contrib/gcp/auth/GcpAuthExtensionEndToEndTest.java @@ -51,7 +51,7 @@ @SpringBootTest( classes = {Application.class}, webEnvironment = WebEnvironment.RANDOM_PORT) -public class GcpAuthExtensionEndToEndTest { +class GcpAuthExtensionEndToEndTest { @LocalServerPort private int testApplicationPort; // port at which the spring app is running From dae1381e0786cee864bfa83193092ee4678927e0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 24 Aug 2025 20:07:27 +0000 Subject: [PATCH 26/48] Changes before error encountered Co-authored-by: trask <218610+trask@users.noreply.github.com> --- .../main/java/io/opentelemetry/ibm/mq/WmqContext.java | 2 +- .../main/java/io/opentelemetry/ibm/mq/WmqMonitor.java | 2 +- .../io/opentelemetry/ibm/mq/config/ExcludeFilters.java | 2 +- .../io/opentelemetry/ibm/mq/config/QueueManager.java | 2 +- .../io/opentelemetry/ibm/mq/config/ResourceFilters.java | 2 +- .../ibm/mq/metricscollector/MessageBuddy.java | 2 +- .../main/java/io/opentelemetry/ibm/mq/util/WmqUtil.java | 2 +- .../ibm/mq/metricscollector/MetricAssert.java | 9 +++++---- 8 files changed, 12 insertions(+), 11 deletions(-) diff --git a/ibm-mq-metrics/src/main/java/io/opentelemetry/ibm/mq/WmqContext.java b/ibm-mq-metrics/src/main/java/io/opentelemetry/ibm/mq/WmqContext.java index 6ded88547..b3fafadb6 100644 --- a/ibm-mq-metrics/src/main/java/io/opentelemetry/ibm/mq/WmqContext.java +++ b/ibm-mq-metrics/src/main/java/io/opentelemetry/ibm/mq/WmqContext.java @@ -17,7 +17,7 @@ * authorization.
* It also validates the arguments passed for various scenarios. */ -public class WmqContext { +public final class WmqContext { private static final String TRANSPORT_TYPE_CLIENT = "Client"; private static final String TRANSPORT_TYPE_BINDINGS = "Bindings"; diff --git a/ibm-mq-metrics/src/main/java/io/opentelemetry/ibm/mq/WmqMonitor.java b/ibm-mq-metrics/src/main/java/io/opentelemetry/ibm/mq/WmqMonitor.java index 832527fb3..9611604cb 100644 --- a/ibm-mq-metrics/src/main/java/io/opentelemetry/ibm/mq/WmqMonitor.java +++ b/ibm-mq-metrics/src/main/java/io/opentelemetry/ibm/mq/WmqMonitor.java @@ -43,7 +43,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class WmqMonitor { +public final class WmqMonitor { private static final Logger logger = LoggerFactory.getLogger(WmqMonitor.class); diff --git a/ibm-mq-metrics/src/main/java/io/opentelemetry/ibm/mq/config/ExcludeFilters.java b/ibm-mq-metrics/src/main/java/io/opentelemetry/ibm/mq/config/ExcludeFilters.java index f02f05cc0..862edd30a 100644 --- a/ibm-mq-metrics/src/main/java/io/opentelemetry/ibm/mq/config/ExcludeFilters.java +++ b/ibm-mq-metrics/src/main/java/io/opentelemetry/ibm/mq/config/ExcludeFilters.java @@ -12,7 +12,7 @@ import java.util.Set; /** A jackson databind class used for config. */ -public class ExcludeFilters { +public final class ExcludeFilters { private String type = "UNKNOWN"; private Set values = new HashSet<>(); diff --git a/ibm-mq-metrics/src/main/java/io/opentelemetry/ibm/mq/config/QueueManager.java b/ibm-mq-metrics/src/main/java/io/opentelemetry/ibm/mq/config/QueueManager.java index 685840977..11769832f 100644 --- a/ibm-mq-metrics/src/main/java/io/opentelemetry/ibm/mq/config/QueueManager.java +++ b/ibm-mq-metrics/src/main/java/io/opentelemetry/ibm/mq/config/QueueManager.java @@ -10,7 +10,7 @@ /** This is a jackson databind class used purely for config. */ @JsonIgnoreProperties(ignoreUnknown = true) -public class QueueManager { +public final class QueueManager { @Nullable private String host; private int port = -1; diff --git a/ibm-mq-metrics/src/main/java/io/opentelemetry/ibm/mq/config/ResourceFilters.java b/ibm-mq-metrics/src/main/java/io/opentelemetry/ibm/mq/config/ResourceFilters.java index 72a3a9f42..86a30360e 100644 --- a/ibm-mq-metrics/src/main/java/io/opentelemetry/ibm/mq/config/ResourceFilters.java +++ b/ibm-mq-metrics/src/main/java/io/opentelemetry/ibm/mq/config/ResourceFilters.java @@ -8,7 +8,7 @@ import java.util.HashSet; import java.util.Set; -public class ResourceFilters { +public final class ResourceFilters { private Set include = new HashSet<>(); private Set exclude = new HashSet<>(); diff --git a/ibm-mq-metrics/src/main/java/io/opentelemetry/ibm/mq/metricscollector/MessageBuddy.java b/ibm-mq-metrics/src/main/java/io/opentelemetry/ibm/mq/metricscollector/MessageBuddy.java index 6ed74dad9..688f9541d 100644 --- a/ibm-mq-metrics/src/main/java/io/opentelemetry/ibm/mq/metricscollector/MessageBuddy.java +++ b/ibm-mq-metrics/src/main/java/io/opentelemetry/ibm/mq/metricscollector/MessageBuddy.java @@ -12,7 +12,7 @@ import com.ibm.mq.headers.pcf.PCFMessage; import java.time.Instant; -public class MessageBuddy { +public final class MessageBuddy { private MessageBuddy() {} diff --git a/ibm-mq-metrics/src/main/java/io/opentelemetry/ibm/mq/util/WmqUtil.java b/ibm-mq-metrics/src/main/java/io/opentelemetry/ibm/mq/util/WmqUtil.java index cefa9e5d9..cf633b953 100644 --- a/ibm-mq-metrics/src/main/java/io/opentelemetry/ibm/mq/util/WmqUtil.java +++ b/ibm-mq-metrics/src/main/java/io/opentelemetry/ibm/mq/util/WmqUtil.java @@ -16,7 +16,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class WmqUtil { +public final class WmqUtil { private static final Logger logger = LoggerFactory.getLogger(WmqUtil.class); diff --git a/ibm-mq-metrics/src/test/java/io/opentelemetry/ibm/mq/metricscollector/MetricAssert.java b/ibm-mq-metrics/src/test/java/io/opentelemetry/ibm/mq/metricscollector/MetricAssert.java index 25d173d3d..bc5c4da11 100644 --- a/ibm-mq-metrics/src/test/java/io/opentelemetry/ibm/mq/metricscollector/MetricAssert.java +++ b/ibm-mq-metrics/src/test/java/io/opentelemetry/ibm/mq/metricscollector/MetricAssert.java @@ -5,11 +5,12 @@ package io.opentelemetry.ibm.mq.metricscollector; +import static org.assertj.core.api.Assertions.assertThat; + import io.opentelemetry.sdk.metrics.data.LongPointData; import io.opentelemetry.sdk.metrics.data.MetricData; -import org.assertj.core.api.Assertions; -public class MetricAssert { +public final class MetricAssert { private final MetricData metric; private final int pointOffset; @@ -24,12 +25,12 @@ static MetricAssert assertThatMetric(MetricData metric, int pointOffset) { } MetricAssert hasName(String name) { - Assertions.assertThat(metric.getName()).isEqualTo(name); + assertThat(metric.getName()).isEqualTo(name); return this; } MetricAssert hasValue(long value) { - Assertions.assertThat( + assertThat( ((LongPointData) metric.getLongGaugeData().getPoints().toArray()[this.pointOffset]) .getValue()) .isEqualTo(value); From 899eef12e09c9ff08e1e8c86fce2ab338877b340 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 24 Aug 2025 20:08:34 +0000 Subject: [PATCH 27/48] Initial plan From a3811f2303d39226ce7751c1a12c6eba7d49ced3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 24 Aug 2025 20:09:18 +0000 Subject: [PATCH 28/48] Changes before error encountered Co-authored-by: trask <218610+trask@users.noreply.github.com> --- .../ParentBasedConsistentProbabilitySamplerProvider.java | 2 ++ ...try.sdk.autoconfigure.spi.traces.ConfigurableSamplerProvider | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) delete mode 100644 consistent-sampling/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.traces.ConfigurableSamplerProvider diff --git a/consistent-sampling/src/main/java/io/opentelemetry/contrib/sampler/consistent/ParentBasedConsistentProbabilitySamplerProvider.java b/consistent-sampling/src/main/java/io/opentelemetry/contrib/sampler/consistent/ParentBasedConsistentProbabilitySamplerProvider.java index 0ca7e17a9..12363b27f 100644 --- a/consistent-sampling/src/main/java/io/opentelemetry/contrib/sampler/consistent/ParentBasedConsistentProbabilitySamplerProvider.java +++ b/consistent-sampling/src/main/java/io/opentelemetry/contrib/sampler/consistent/ParentBasedConsistentProbabilitySamplerProvider.java @@ -5,10 +5,12 @@ package io.opentelemetry.contrib.sampler.consistent; +import com.google.auto.service.AutoService; import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties; import io.opentelemetry.sdk.autoconfigure.spi.traces.ConfigurableSamplerProvider; import io.opentelemetry.sdk.trace.samplers.Sampler; +@AutoService(ConfigurableSamplerProvider.class) public final class ParentBasedConsistentProbabilitySamplerProvider implements ConfigurableSamplerProvider { diff --git a/consistent-sampling/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.traces.ConfigurableSamplerProvider b/consistent-sampling/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.traces.ConfigurableSamplerProvider deleted file mode 100644 index 948fcc325..000000000 --- a/consistent-sampling/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.traces.ConfigurableSamplerProvider +++ /dev/null @@ -1 +0,0 @@ -io.opentelemetry.contrib.sampler.consistent.ParentBasedConsistentProbabilitySamplerProvider From 5870a471b57d16eaba99fbd3d2546701b90da43a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 24 Aug 2025 20:10:37 +0000 Subject: [PATCH 29/48] Initial plan From a08f1044544ff2bbfd270b199cd187ada8c471cb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 24 Aug 2025 20:12:39 +0000 Subject: [PATCH 30/48] Initial plan From fb512919c21e398cc68732dc393c8885cf623daa Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 24 Aug 2025 20:13:24 +0000 Subject: [PATCH 31/48] Changes before error encountered Co-authored-by: trask <218610+trask@users.noreply.github.com> --- .../contrib/jfr/connection/JfrConnectionException.java | 2 +- .../contrib/jfr/connection/PredefinedConfiguration.java | 2 +- .../java/io/opentelemetry/contrib/jfr/connection/Recording.java | 2 +- .../opentelemetry/contrib/jfr/connection/RecordingOptions.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/jfr-connection/src/main/java/io/opentelemetry/contrib/jfr/connection/JfrConnectionException.java b/jfr-connection/src/main/java/io/opentelemetry/contrib/jfr/connection/JfrConnectionException.java index bff9c7dd7..8d805d31c 100644 --- a/jfr-connection/src/main/java/io/opentelemetry/contrib/jfr/connection/JfrConnectionException.java +++ b/jfr-connection/src/main/java/io/opentelemetry/contrib/jfr/connection/JfrConnectionException.java @@ -37,7 +37,7 @@ * This cause indicates a bug in the io.opentelemetry.contrib.jfr.connection package code. * */ -public class JfrConnectionException extends Exception { +public final class JfrConnectionException extends Exception { private static final long serialVersionUID = 7394612902107510439L; diff --git a/jfr-connection/src/main/java/io/opentelemetry/contrib/jfr/connection/PredefinedConfiguration.java b/jfr-connection/src/main/java/io/opentelemetry/contrib/jfr/connection/PredefinedConfiguration.java index 521638dfb..ae54bbf65 100644 --- a/jfr-connection/src/main/java/io/opentelemetry/contrib/jfr/connection/PredefinedConfiguration.java +++ b/jfr-connection/src/main/java/io/opentelemetry/contrib/jfr/connection/PredefinedConfiguration.java @@ -17,7 +17,7 @@ * option of the JVM option 'StartFlightRecording', for example {@code * -XX:StartFlightRecording:settings=default.jfc}. */ -public class PredefinedConfiguration implements RecordingConfiguration { +public final class PredefinedConfiguration implements RecordingConfiguration { private final String configurationName; @Override diff --git a/jfr-connection/src/main/java/io/opentelemetry/contrib/jfr/connection/Recording.java b/jfr-connection/src/main/java/io/opentelemetry/contrib/jfr/connection/Recording.java index 4d26f8647..e9f3ba971 100644 --- a/jfr-connection/src/main/java/io/opentelemetry/contrib/jfr/connection/Recording.java +++ b/jfr-connection/src/main/java/io/opentelemetry/contrib/jfr/connection/Recording.java @@ -21,7 +21,7 @@ * @see jdk.jfr.Recording */ -public class Recording implements AutoCloseable { +public final class Recording implements AutoCloseable { /** * A {@code Recording} may be in one of these states. Note that a {@code Recording} is no longer diff --git a/jfr-connection/src/main/java/io/opentelemetry/contrib/jfr/connection/RecordingOptions.java b/jfr-connection/src/main/java/io/opentelemetry/contrib/jfr/connection/RecordingOptions.java index 4c95d9ec9..c7a554c89 100644 --- a/jfr-connection/src/main/java/io/opentelemetry/contrib/jfr/connection/RecordingOptions.java +++ b/jfr-connection/src/main/java/io/opentelemetry/contrib/jfr/connection/RecordingOptions.java @@ -41,7 +41,7 @@ * it does mean that the Builder needs to validate the args and potentially throw * IllegalArgumentException. String makes the overall code so much simpler. */ -public class RecordingOptions { +public final class RecordingOptions { private static final String NO_LIMIT = "0"; From fc7816484dbceeea971daa3ef1d819f4e4049a8d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 24 Aug 2025 20:13:45 +0000 Subject: [PATCH 32/48] Changes before error encountered Co-authored-by: trask <218610+trask@users.noreply.github.com> --- .../contrib/jmxmetrics/ConfigurationException.java | 2 +- .../contrib/jmxmetrics/GroovyRunner.java | 12 ++++++------ .../opentelemetry/contrib/jmxmetrics/JmxClient.java | 2 +- .../contrib/jmxmetrics/InstrumentDescriptor.java | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/jmx-metrics/src/main/groovy/io/opentelemetry/contrib/jmxmetrics/ConfigurationException.java b/jmx-metrics/src/main/groovy/io/opentelemetry/contrib/jmxmetrics/ConfigurationException.java index a1d04dfa8..1c0bcd68f 100644 --- a/jmx-metrics/src/main/groovy/io/opentelemetry/contrib/jmxmetrics/ConfigurationException.java +++ b/jmx-metrics/src/main/groovy/io/opentelemetry/contrib/jmxmetrics/ConfigurationException.java @@ -5,7 +5,7 @@ package io.opentelemetry.contrib.jmxmetrics; -public class ConfigurationException extends RuntimeException { +public final class ConfigurationException extends RuntimeException { private static final long serialVersionUID = 0L; public ConfigurationException(final String message, final Throwable cause) { diff --git a/jmx-metrics/src/main/groovy/io/opentelemetry/contrib/jmxmetrics/GroovyRunner.java b/jmx-metrics/src/main/groovy/io/opentelemetry/contrib/jmxmetrics/GroovyRunner.java index ab0a8045e..a34abbbe1 100644 --- a/jmx-metrics/src/main/groovy/io/opentelemetry/contrib/jmxmetrics/GroovyRunner.java +++ b/jmx-metrics/src/main/groovy/io/opentelemetry/contrib/jmxmetrics/GroovyRunner.java @@ -29,22 +29,22 @@ import java.util.logging.Logger; import org.codehaus.groovy.control.CompilationFailedException; -public class GroovyRunner { +public final class GroovyRunner { private static final Logger logger = Logger.getLogger(GroovyRunner.class.getName()); private final List