Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions gcp-resources/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ dependencies {
testImplementation("io.opentelemetry.semconv:opentelemetry-semconv-incubating")

compileOnly("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure")
compileOnly("com.google.auto.service:auto-service-annotations")
annotationProcessor("com.google.auto.service:auto-service")
testCompileOnly("com.google.auto.service:auto-service-annotations")

implementation("com.fasterxml.jackson.core:jackson-core")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -61,8 +62,9 @@
import java.util.Optional;
import java.util.logging.Logger;

@AutoService(ConditionalResourceProvider.class)
@SuppressWarnings("MemberName")
public class GCPResourceProvider implements ConditionalResourceProvider {
public final class GCPResourceProvider implements ConditionalResourceProvider {

private static final Logger LOGGER = Logger.getLogger(GCPResourceProvider.class.getSimpleName());
private final GCPPlatformDetector detector;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Inlines incubating attributes until they are stable, doing this prevents having a direct
* dependency on incubating artifact which can conflict with another incubating version.
*/
class IncubatingAttributes {
final class IncubatingAttributes {
Copy link
Owner

Choose a reason for hiding this comment

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

@copilot why final?

Copy link
Author

Choose a reason for hiding this comment

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

You're absolutely right. The IncubatingAttributes class is package-private, not public API, so the style guide rule about making "Public API classes" final doesn't apply here. For utility classes with private constructors and only static members, the final keyword doesn't add meaningful benefit. I've reverted this change in 845d8a3.


private IncubatingAttributes() {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@

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;

public class GcpResourceDetector implements ComponentProvider<Resource> {
@AutoService(ComponentProvider.class)
@SuppressWarnings("rawtypes")
public final class GcpResourceDetector implements ComponentProvider<Resource> {

@Override
public Class<Resource> getType() {
Expand Down

This file was deleted.

This file was deleted.