Skip to content

Reuse NoOpenTelemetryAgentCondition - #460

Merged
skjolber merged 1 commit into
opentelemetryfrom
openetelemetry-single-condition
Aug 17, 2026
Merged

Reuse NoOpenTelemetryAgentCondition#460
skjolber merged 1 commit into
opentelemetryfrom
openetelemetry-single-condition

Conversation

@skjolber

@skjolber skjolber commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Allow apps to use this as well

@skjolber
skjolber requested review from a team as code owners August 17, 2026 08:08
@skjolber
skjolber requested a lite review from Copilot and removed request for a team August 17, 2026 08:14
@skjolber
skjolber merged commit 9fb8628 into opentelemetry Aug 17, 2026
2 checks passed
@skjolber
skjolber deleted the openetelemetry-single-condition branch August 17, 2026 08:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR centralizes the “no OpenTelemetry Java agent present” Spring Condition so it can be reused across multiple GCP Spring Boot auto-configurations, replacing duplicate/local implementations.

Changes:

  • Moved NoOpenTelemetryAgentCondition into no.entur.logging.cloud.gcp.spring and reused it from multiple auto-configs.
  • Removed the nested condition from GcpMicrometerTraceAutoConfiguration and updated GCP web/grpc trace auto-configurations to reference the shared condition.
  • Adjusted module dependencies to enable cross-module reuse.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
gcp/spring-boot-autoconfigure-gcp/src/main/java/no/entur/logging/cloud/gcp/spring/NoOpenTelemetryAgentCondition.java Relocates the shared condition into the GCP autoconfigure module/package.
gcp/spring-boot-autoconfigure-gcp/src/main/java/no/entur/logging/cloud/gcp/spring/GcpMicrometerTraceAutoConfiguration.java Switches from an inner condition class to the shared NoOpenTelemetryAgentCondition.
gcp/spring-boot-autoconfigure-gcp/build.gradle Removes an unused dependency from the autoconfigure module.
gcp/correlation-id-trace-spring-boot-gcp-web/src/main/java/no/entur/logging/cloud/gcp/trace/spring/web/NoOpenTelemetryAgentCondition.java Removes the previously-local condition implementation (now shared elsewhere).
gcp/correlation-id-trace-spring-boot-gcp-web/src/main/java/no/entur/logging/cloud/gcp/trace/spring/web/GcpTraceAutoConfiguration.java Updates to import and use the shared condition class.
gcp/correlation-id-trace-spring-boot-gcp-web/build.gradle Adds a dependency to access the shared condition.
gcp/correlation-id-trace-spring-boot-gcp-grpc/src/main/java/no/entur/logging/cloud/gcp/trace/spring/grpc/GcpGrpcTraceAutoConfiguration.java Updates to import and use the shared condition class.
gcp/correlation-id-trace-spring-boot-gcp-grpc/build.gradle Adds a dependency to access the shared condition.
Suppressed comments (1)

gcp/spring-boot-autoconfigure-gcp/src/main/java/no/entur/logging/cloud/gcp/spring/NoOpenTelemetryAgentCondition.java:5

  • This class appears to have been moved/renamed at the package level (from a previously published package) and is public. That is a binary-breaking change for any external consumers that referenced the old FQCN.

If backward compatibility is required, consider keeping a deprecated type at the old FQCN that delegates to this condition for one major version (or document the breaking change explicitly).


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 6 to 9
api project(':trace:server:correlation-id-trace-spring-boot-web')
api project(':gcp:logback-logstash-encoder-gcp')
api project(':gcp:spring-boot-autoconfigure-gcp')

Comment on lines 5 to 9
api project(':trace:server:correlation-id-trace-spring-boot-grpc')
api project(':gcp:logback-logstash-encoder-gcp')
api project(':gcp:spring-boot-autoconfigure-gcp')

api("org.springframework.boot:spring-boot-autoconfigure")
Comment on lines 3 to 6
import jakarta.servlet.DispatcherType;
import no.entur.logging.cloud.gcp.spring.NoOpenTelemetryAgentCondition;
import no.entur.logging.cloud.trace.spring.web.CorrelationIdAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants