Opentelemetry support - #450
Conversation
GKE ingests structured JSON logs written to stdout. The logging agent promotes only its reserved logging.googleapis.com/trace and logging.googleapis.com/spanId keys to the corresponding LogEntry fields; ordinary traceId and spanId keys remain in jsonPayload. Map the real OpenTelemetry trace and span IDs to those reserved keys. Prefer OpenTelemetry values over legacy MDC values and avoid duplicate JSON fields. See: https://docs.cloud.google.com/logging/docs/agent/logging/configuration#special-fields Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR extends cloud-logging’s GCP/Azure structured logging to work with both the OpenTelemetry Java agent and Spring Boot’s native OpenTelemetry starter (Micrometer bridge), primarily by translating MDC trace/span fields into the platform-specific JSON keys and disabling legacy correlation-id → trace mappings when OTel is present.
Changes:
- Add GCP MDC providers that map OTel agent (
trace_id/span_id/trace_flags) and Micrometer (traceId/spanId/traceSampled) MDC fields into GCP “special fields”. - Add Azure encoder support for OTel agent MDC (
trace_id/span_id) → Azure (traceId/spanId) field mapping. - Add multiple new OTel-focused example apps (web + gRPC; agent + starter) and tests asserting produced JSON output.
Reviewed changes
Copilot reviewed 103 out of 104 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| test/test-logback-junit/src/main/java/no/entur/logging/cloud/logback/logstash/test/junit/LogStatement.java | Adds JSON parsing helpers for tests to assert specific fields in captured log lines. |
| settings.gradle | Registers new OTEL example subprojects. |
| build.gradle | Aligns versions plugin application with the plugin id declared in plugins {}. |
| gcp/spring-boot-autoconfigure-gcp/build.gradle | Adds Micrometer tracing dependency to support sampling propagation. |
| gcp/spring-boot-autoconfigure-gcp/src/main/java/no/entur/logging/cloud/gcp/spring/GlobalSamplingLoggingHandler.java | Adds an ObservationHandler that stamps sampling info into MDC. |
| gcp/spring-boot-autoconfigure-gcp-test/src/main/resources/logback/spring-defaults-test.xml | Adjusts test console pattern (removes correlation pattern placeholder). |
| gcp/logback-logstash-encoder-gcp/src/main/java/no/entur/logging/cloud/gcp/logback/logstash/StackdriverOpenTelemetryTraceMdcJsonProvider.java | Maps OTel agent MDC keys to GCP reserved structured logging fields; adds agent detection helper. |
| gcp/logback-logstash-encoder-gcp/src/main/java/no/entur/logging/cloud/gcp/logback/logstash/StackdriverMicrometerTraceMdcJsonProvider.java | Maps Micrometer tracing MDC keys to GCP reserved structured logging fields. |
| gcp/logback-logstash-encoder-gcp/src/main/java/no/entur/logging/cloud/gcp/logback/logstash/StackdriverLogstashEncoder.java | Switches MDC mapping provider based on whether the OTel Java agent is detected. |
| gcp/logback-logstash-encoder-gcp/src/test/java/no/entur/logging/cloud/gcp/logback/logstash/StackdriverOpenTelemetryTraceMdcJsonProviderTest.java | Adds tests validating GCP trace/span field mapping behavior. |
| gcp/correlation-id-trace-spring-boot-gcp-web/src/main/java/no/entur/logging/cloud/gcp/trace/spring/web/NoOpenTelemetryAgentCondition.java | New condition to disable legacy correlation-id trace filter when OTel agent is present. |
| gcp/correlation-id-trace-spring-boot-gcp-web/src/main/java/no/entur/logging/cloud/gcp/trace/spring/web/GcpTraceMdcSupportBuilder.java | Marks legacy builder deprecated (legacy correlation-based tracing path). |
| gcp/correlation-id-trace-spring-boot-gcp-web/src/main/java/no/entur/logging/cloud/gcp/trace/spring/web/GcpTraceMdcSupport.java | Marks legacy helper deprecated (legacy correlation-based tracing path). |
| gcp/correlation-id-trace-spring-boot-gcp-web/src/main/java/no/entur/logging/cloud/gcp/trace/spring/web/GcpTraceFilter.java | Marks legacy servlet filter deprecated (legacy correlation-based tracing path). |
| gcp/correlation-id-trace-spring-boot-gcp-web/src/main/java/no/entur/logging/cloud/gcp/trace/spring/web/GcpTraceAutoConfiguration.java | Disables legacy trace filter when OTel starter is on classpath or agent is detected. |
| gcp/correlation-id-trace-spring-boot-gcp-web/README.md | Updates README to reflect MDC fields produced and OTel-based auto-disable behavior. |
| gcp/correlation-id-trace-spring-boot-gcp-web/build.gradle | Adds dependency on GCP logstash encoder for agent detection. |
| gcp/correlation-id-trace-spring-boot-gcp-grpc/src/main/java/no/entur/logging/cloud/gcp/trace/spring/grpc/NoOpenTelemetryAgentCondition.java | New condition to disable legacy correlation-id gRPC interceptor when OTel agent is present. |
| gcp/correlation-id-trace-spring-boot-gcp-grpc/src/main/java/no/entur/logging/cloud/gcp/trace/spring/grpc/interceptor/OrderedTraceIdGrpcMdcContextServerInterceptor.java | Marks legacy trace interceptor deprecated. |
| gcp/correlation-id-trace-spring-boot-gcp-grpc/src/main/java/no/entur/logging/cloud/gcp/trace/spring/grpc/GcpGrpcTraceAutoConfiguration.java | Disables legacy trace interceptor when OTel starter is on classpath or agent is detected. |
| gcp/correlation-id-trace-spring-boot-gcp-grpc/README.md | Updates README to reflect OTel-based auto-disable behavior. |
| gcp/correlation-id-trace-spring-boot-gcp-grpc/build.gradle | Adds dependency on GCP logstash encoder for agent detection. |
| azure/spring-boot-autoconfigure-azure-test/src/main/resources/logback/spring-defaults-test.xml | Adjusts test console pattern (removes correlation pattern placeholder). |
| azure/logback-logstash-encoder-azure/src/main/java/no/entur/logging/cloud/azure/logback/logstash/AzureOpenTelemetryTraceMdcJsonProvider.java | Adds OTel agent MDC → Azure field mapping provider + agent detection helper. |
| azure/logback-logstash-encoder-azure/src/main/java/no/entur/logging/cloud/azure/logback/logstash/AzureLogstashEncoder.java | Replaces default MDC provider with Azure OTel mapping provider when agent is detected. |
| examples/gcp-web-without-test-artifacts-example/build.gradle | Adds OTel starter/testing deps to existing “without test artifacts” web example. |
| examples/gcp-grpc-spring-without-test-artifacts-example/src/main/java/no/entur/grpc/example/GreetingController.java | Removes legacy trace-id interceptor from example interceptor chain. |
| examples/gcp-grpc-spring-without-test-artifacts-example/src/main/java/no/entur/grpc/example/GreetingControllerWithOnDemandLogging.java | Removes legacy trace-id interceptor from example on-demand interceptor chain. |
| examples/gcp-grpc-spring-without-test-artifacts-example/build.gradle | Adds OTel starter/testing deps to existing “without test artifacts” gRPC example. |
| examples/gcp-grpc-spring-example/src/main/java/no/entur/grpc/example/GreetingController.java | Removes legacy trace-id interceptor from example interceptor chain. |
| examples/gcp-grpc-spring-example/src/main/java/no/entur/grpc/example/GreetingControllerWithOnDemandLogging.java | Removes legacy trace-id interceptor from example on-demand interceptor chain. |
| examples/gcp-web-without-test-artifacts-otel-starter-example/build.gradle | New web example using Spring Boot OTel starter (machine-readable JSON) + tests. |
| examples/gcp-web-without-test-artifacts-otel-starter-example/README.md | Documents the new OTel starter “without test artifacts” web example. |
| examples/gcp-web-without-test-artifacts-otel-starter-example/src/main/resources/application.properties | Config for new OTel starter “without test artifacts” web example. |
| examples/gcp-web-without-test-artifacts-otel-starter-example/src/main/java/org/entur/example/web/DemoApplication.java | Spring Boot main for new OTel starter “without test artifacts” web example. |
| examples/gcp-web-without-test-artifacts-otel-starter-example/src/main/java/org/entur/example/web/config/LogConfiguration.java | Logbook body filter example (masking secret field). |
| examples/gcp-web-without-test-artifacts-otel-starter-example/src/main/java/org/entur/example/web/config/WebSecurityConfig.java | Example security configuration for the app. |
| examples/gcp-web-without-test-artifacts-otel-starter-example/src/main/java/org/entur/example/web/rest/DocumentEndpoint.java | Example REST endpoints producing logs and large payloads. |
| examples/gcp-web-without-test-artifacts-otel-starter-example/src/main/java/org/entur/example/web/rest/MyEntity.java | Example DTO used by endpoints/tests. |
| examples/gcp-web-without-test-artifacts-otel-starter-example/src/test/java/org/entur/example/web/otel/agent/WebLoggingFormatTest.java | Tests log output contains GCP trace/span fields. |
| examples/gcp-web-without-test-artifacts-otel-starter-example/src/test/java/org/entur/example/web/otel/agent/OndemandWebLoggingHttpOkHighLogLevelTest.java | Tests on-demand logging behavior with OTel starter example. |
| examples/gcp-web-without-test-artifacts-otel-agent-example/build.gradle | New web example running tests with OTel Java agent attached. |
| examples/gcp-web-without-test-artifacts-otel-agent-example/README.md | Documents the new OTel agent “without test artifacts” web example. |
| examples/gcp-web-without-test-artifacts-otel-agent-example/src/main/resources/application.properties | Config for new OTel agent “without test artifacts” web example. |
| examples/gcp-web-without-test-artifacts-otel-agent-example/src/main/java/org/entur/example/web/DemoApplication.java | Spring Boot main for new OTel agent “without test artifacts” web example. |
| examples/gcp-web-without-test-artifacts-otel-agent-example/src/main/java/org/entur/example/web/config/LogConfiguration.java | Logbook body filter example (masking secret field). |
| examples/gcp-web-without-test-artifacts-otel-agent-example/src/main/java/org/entur/example/web/config/WebSecurityConfig.java | Example security configuration for the app. |
| examples/gcp-web-without-test-artifacts-otel-agent-example/src/main/java/org/entur/example/web/rest/DocumentEndpoint.java | Example REST endpoints producing logs and large payloads. |
| examples/gcp-web-without-test-artifacts-otel-agent-example/src/main/java/org/entur/example/web/rest/MyEntity.java | Example DTO used by endpoints/tests. |
| examples/gcp-web-without-test-artifacts-otel-agent-example/src/test/java/org/entur/example/web/otel/agent/WebLoggingFormatTest.java | Tests log output contains GCP trace/span fields. |
| examples/gcp-web-without-test-artifacts-otel-agent-example/src/test/java/org/entur/example/web/otel/agent/OndemandWebLoggingHttpOkHighLogLevelTest.java | Tests on-demand logging behavior with OTel agent example. |
| examples/gcp-web-otel-starter-example/build.gradle | New web example using OTel starter plus local dev bootRun configuration. |
| examples/gcp-web-otel-starter-example/README.md | Documents the new OTel starter web example. |
| examples/gcp-web-otel-starter-example/src/main/resources/application.properties | Config for new OTel starter web example. |
| examples/gcp-web-otel-starter-example/src/main/java/org/entur/example/web/DemoApplication.java | Spring Boot main for new OTel starter web example. |
| examples/gcp-web-otel-starter-example/src/main/java/org/entur/example/web/config/LogConfiguration.java | Logbook body filter example (masking secret field). |
| examples/gcp-web-otel-starter-example/src/main/java/org/entur/example/web/config/WebSecurityConfig.java | Security config + example filters for MDC enrichment and auth behavior. |
| examples/gcp-web-otel-starter-example/src/main/java/org/entur/example/web/config/UserIdEnricherFilter.java | Example filter enriching MDC (subject) for testing. |
| examples/gcp-web-otel-starter-example/src/main/java/org/entur/example/web/config/ReturnHttp401AuthenticationHeaderFilter.java | Example filter returning 401 under certain Authorization header. |
| examples/gcp-web-otel-starter-example/src/main/java/org/entur/example/web/rest/DocumentEndpoint.java | Richer REST example with multiple endpoints and error cases. |
| examples/gcp-web-otel-starter-example/src/main/java/org/entur/example/web/rest/MyEntity.java | Example DTO used by endpoints/tests. |
| examples/gcp-web-otel-starter-example/src/test/java/org/entur/example/web/otel/starter/WebLoggingFormatTest.java | Tests log output contains GCP trace/span fields across encoder modes. |
| examples/gcp-web-otel-starter-example/src/test/java/org/entur/example/web/otel/starter/OndemandWebLoggingHttpOkHighLogLevelTest.java | Tests on-demand logging behavior for OTel starter web example. |
| examples/gcp-web-otel-agent-example/build.gradle | New web example running tests with OTel Java agent attached + bootRun dev config. |
| examples/gcp-web-otel-agent-example/README.md | Documents the new OTel agent web example. |
| examples/gcp-web-otel-agent-example/src/main/resources/application.properties | Config for new OTel agent web example. |
| examples/gcp-web-otel-agent-example/src/main/java/org/entur/example/web/DemoApplication.java | Spring Boot main for new OTel agent web example. |
| examples/gcp-web-otel-agent-example/src/main/java/org/entur/example/web/config/LogConfiguration.java | Logbook body filter example (masking secret field). |
| examples/gcp-web-otel-agent-example/src/main/java/org/entur/example/web/config/WebSecurityConfig.java | Security config + example filters for MDC enrichment and auth behavior. |
| examples/gcp-web-otel-agent-example/src/main/java/org/entur/example/web/config/UserIdEnricherFilter.java | Example filter enriching MDC (subject) for testing. |
| examples/gcp-web-otel-agent-example/src/main/java/org/entur/example/web/config/ReturnHttp401AuthenticationHeaderFilter.java | Example filter returning 401 under certain Authorization header. |
| examples/gcp-web-otel-agent-example/src/main/java/org/entur/example/web/rest/DocumentEndpoint.java | Richer REST example with multiple endpoints and error cases. |
| examples/gcp-web-otel-agent-example/src/main/java/org/entur/example/web/rest/MyEntity.java | Example DTO used by endpoints/tests. |
| examples/gcp-web-otel-agent-example/src/test/java/org/entur/example/web/WebLoggingFormatTest.java | Tests log output contains GCP trace/span fields across encoder modes. |
| examples/gcp-web-otel-agent-example/src/test/java/org/entur/example/web/OndemandWebLoggingHttpOkHighLogLevelTest.java | Tests on-demand logging behavior for OTel agent web example. |
| examples/gcp-web-otel-agent-example/src/test/java/org/entur/example/web/ActuatorTest.java | Exercises actuator readiness endpoint under different encoder modes. |
| examples/gcp-grpc-spring-without-test-artifacts-otel-starter-example/build.gradle | New gRPC example (Spring) using OTel starter + protobuf generation. |
| examples/gcp-grpc-spring-without-test-artifacts-otel-starter-example/README.md | Documents the new OTel starter gRPC “without test artifacts” example. |
| examples/gcp-grpc-spring-without-test-artifacts-otel-starter-example/src/main/resources/application.properties | Config for new OTel starter gRPC example. |
| examples/gcp-grpc-spring-without-test-artifacts-otel-starter-example/src/main/proto/greeting_service.proto | New proto definitions for example service. |
| examples/gcp-grpc-spring-without-test-artifacts-otel-starter-example/src/main/proto/greeting_message.proto | New proto message types for example service. |
| examples/gcp-grpc-spring-without-test-artifacts-otel-starter-example/src/main/java/no/entur/grpc/example/DemoApplication.java | Spring Boot main for new gRPC example. |
| examples/gcp-grpc-spring-without-test-artifacts-otel-starter-example/src/main/java/no/entur/grpc/example/MyGrpcConfig.java | Example gRPC configuration incl. logging filters and interceptors. |
| examples/gcp-grpc-spring-without-test-artifacts-otel-starter-example/src/main/java/no/entur/grpc/example/MyValidationServerInterceptor.java | Example interceptor emitting structured error status. |
| examples/gcp-grpc-spring-without-test-artifacts-otel-starter-example/src/main/java/no/entur/grpc/example/AbstractGreetingController.java | Example gRPC service implementation producing logs and errors. |
| examples/gcp-grpc-spring-without-test-artifacts-otel-starter-example/src/main/java/no/entur/grpc/example/GreetingController.java | Registers example gRPC service with interceptor chain (non-ondemand). |
| examples/gcp-grpc-spring-without-test-artifacts-otel-starter-example/src/main/java/no/entur/grpc/example/GreetingControllerWithOnDemandLogging.java | Registers example gRPC service with interceptor chain (ondemand). |
| examples/gcp-grpc-spring-without-test-artifacts-otel-starter-example/src/test/java/no/entur/grpc/example/without/test/artifacts/otel/starter/SpringAbstractGrpcTest.java | Test base for asserting GCP trace/span fields in captured logs. |
| examples/gcp-grpc-spring-without-test-artifacts-otel-starter-example/src/test/java/no/entur/grpc/example/without/test/artifacts/otel/starter/SpringGrpcLoggingFormatTest.java | Basic gRPC logging format test under OTel starter. |
| examples/gcp-grpc-spring-without-test-artifacts-otel-starter-example/src/test/java/no/entur/grpc/example/without/test/artifacts/otel/starter/SpringOndemandGrpcLoggingHighLogLevelTest.java | On-demand gRPC logging behavior test under OTel starter. |
| examples/gcp-grpc-spring-without-test-artifacts-otel-agent-example/build.gradle | New gRPC example (Spring) running tests with OTel Java agent attached. |
| examples/gcp-grpc-spring-without-test-artifacts-otel-agent-example/README.md | Documents the new OTel agent gRPC “without test artifacts” example. |
| examples/gcp-grpc-spring-without-test-artifacts-otel-agent-example/src/main/resources/application.properties | Config for new OTel agent gRPC example. |
| examples/gcp-grpc-spring-without-test-artifacts-otel-agent-example/src/main/proto/greeting_service.proto | New proto definitions for agent-backed example service. |
| examples/gcp-grpc-spring-without-test-artifacts-otel-agent-example/src/main/proto/greeting_message.proto | New proto message types for agent-backed example service. |
| examples/gcp-grpc-spring-without-test-artifacts-otel-agent-example/src/main/java/no/entur/grpc/example/DemoApplication.java | Spring Boot main for new gRPC agent example. |
| examples/gcp-grpc-spring-without-test-artifacts-otel-agent-example/src/main/java/no/entur/grpc/example/MyGrpcConfig.java | Example gRPC configuration incl. logging filters and interceptors. |
| examples/gcp-grpc-spring-without-test-artifacts-otel-agent-example/src/main/java/no/entur/grpc/example/MyValidationServerInterceptor.java | Example interceptor emitting structured error status. |
| examples/gcp-grpc-spring-without-test-artifacts-otel-agent-example/src/main/java/no/entur/grpc/example/AbstractGreetingController.java | Example gRPC service implementation producing logs and errors. |
| examples/gcp-grpc-spring-without-test-artifacts-otel-agent-example/src/main/java/no/entur/grpc/example/GreetingController.java | Registers example gRPC service with interceptor chain (non-ondemand). |
| examples/gcp-grpc-spring-without-test-artifacts-otel-agent-example/src/main/java/no/entur/grpc/example/GreetingControllerWithOnDemandLogging.java | Registers example gRPC service with interceptor chain (ondemand). |
| examples/gcp-grpc-spring-without-test-artifacts-otel-agent-example/src/test/java/no/entur/grpc/example/without/test/artifacts/otel/agent/SpringAbstractGrpcTest.java | Test base for asserting GCP trace/span fields in captured logs. |
| examples/gcp-grpc-spring-without-test-artifacts-otel-agent-example/src/test/java/no/entur/grpc/example/without/test/artifacts/otel/agent/SpringGrpcLoggingFormatTest.java | Basic gRPC logging format test under OTel agent. |
| examples/gcp-grpc-spring-without-test-artifacts-otel-agent-example/src/test/java/no/entur/grpc/example/without/test/artifacts/otel/agent/SpringOndemandGrpcLoggingHighLogLevelTest.java | On-demand gRPC logging behavior test under OTel agent. |
Suppressed comments (1)
gcp/logback-logstash-encoder-gcp/src/test/java/no/entur/logging/cloud/gcp/logback/logstash/StackdriverOpenTelemetryTraceMdcJsonProviderTest.java:46
- This test case uses Micrometer-style MDC keys (
traceId/spanId) even though this provider only remaps OTel agent keys (trace_id/span_id).
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
fix: PR 451 - autodetect micrometer+otel starter, add trace_sampled test, fix TraceSampledMdcHandler Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: skjolber <1031478+skjolber@users.noreply.github.com>
…-gcp (#453) feat: move TraceSampledMdcHandler to spring-boot-autoconfigure-gcp with @AutoConfigureAfter and class-level conditions Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: skjolber <1031478+skjolber@users.noreply.github.com>
* Opentelemetry: Restore project id in trace * Use fixed prefix * Update gcp/logback-logstash-encoder-gcp/src/main/java/no/entur/logging/cloud/gcp/logback/logstash/StackdriverLogstashEncoder.java Co-authored-by: Alexander Brevig <alexander.brevig@hey.com> --------- Co-authored-by: Alexander Brevig <alexander.brevig@hey.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…MdcJsonProvider Co-authored-by: skjolber <1031478+skjolber@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 104 out of 105 changed files in this pull request and generated 2 comments.
Suppressed comments (7)
gcp/logback-logstash-encoder-gcp/src/main/java/no/entur/logging/cloud/gcp/logback/logstash/StackdriverOpenTelemetryTraceMdcJsonProvider.java:59
- When MDC contains both
trace_id/span_idand an existing GCP reserved key, this loop emits the reserved property twice: once for the mapped OTel key and again indefault. DuplicatejsonPayloadfields can make Fluentbit drop several seconds of logs. Resolve precedence before writing (prefer the OTel value) and emit each reserved key at most once.
gcp/logback-logstash-encoder-gcp/src/main/java/no/entur/logging/cloud/gcp/logback/logstash/StackdriverMicrometerTraceMdcJsonProvider.java:59 - When MDC also contains
logging.googleapis.com/trace,logging.googleapis.com/spanId, orlogging.googleapis.com/trace_sampled, these mappings produce duplicate JSON properties when the target entry is later written bydefault. This is operationally unsafe for GCP ingestion. Resolve the mapped values first and skip all source/target entries so each reserved field is emitted once.
gcp/logback-logstash-encoder-gcp/src/main/java/no/entur/logging/cloud/gcp/logback/logstash/StackdriverOpenTelemetryTraceMdcJsonProvider.java:105 - Agent detection depends on the agent JAR path containing
opentelemetry, but-javaagentpermits any filename (for example/opt/agent.jar). In that valid deployment the encoder selects the Micrometer provider, leaves the agent's snake_case MDC keys unmapped, and enables legacy fake-trace filters. Avoid filename-based detection; select mappings from the MDC keys present on each event and use an actual agent signal for auto-configuration.
azure/logback-logstash-encoder-azure/src/main/java/no/entur/logging/cloud/azure/logback/logstash/AzureOpenTelemetryTraceMdcJsonProvider.java:66 - This assumes the
-javaagentpath containsopentelemetry, although Java allows the agent JAR to be renamed. With-javaagent:/opt/agent.jar, the Azure MDC provider is not replaced andtrace_id/span_idremain unmapped. Install a provider that can handle both naming schemes, or detect the running agent without relying on its filename.
private static boolean isOtelArgument(String argument) {
String lowerArg = argument.toLowerCase();
return lowerArg.contains("-javaagent:") && lowerArg.contains("opentelemetry");
gcp/spring-boot-autoconfigure-gcp/src/main/java/no/entur/logging/cloud/gcp/spring/TraceSampledMdcHandler.java:41
- Closing any nested observation unconditionally removes the sampled flag belonging to its parent scope. For example, after an observed downstream call closes, subsequent logs in the sampled server observation no longer contain
trace_sampled. Preserve and restore the prior MDC value per observation scope instead of always removing it.
gcp/correlation-id-trace-spring-boot-gcp-web/README.md:4 - Correct the OpenTelemetry product name.
gcp/correlation-id-trace-spring-boot-gcp-grpc/README.md:4 - Correct the OpenTelemetry product name.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: skjolber <1031478+skjolber@users.noreply.github.com>
Support both Opentelemetry agent and Opentelemetry spring boot starter (native Spring). Borrows from #439 and #442.
Not included / future improvements: