Class MicrometerTracingService
java.lang.Object
one.tomorrow.transactionaloutbox.tracing.MicrometerTracingService
- All Implemented Interfaces:
TracingService
@ConditionalOnClass(io.micrometer.tracing.Tracer.class)
@Service
@Primary
public class MicrometerTracingService
extends Object
implements TracingService
Copyright 2025 Tomorrow GmbH @ https://tomorrow.one
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-
Nested Class Summary
Nested classes/interfaces inherited from interface one.tomorrow.transactionaloutbox.tracing.TracingService
TracingService.HeadersOnlyTraceOutboxRecordProcessingResult, TracingService.TraceOutboxRecordProcessingResult -
Field Summary
Fields inherited from interface one.tomorrow.transactionaloutbox.tracing.TracingService
INTERNAL_PREFIX -
Constructor Summary
ConstructorsConstructorDescriptionMicrometerTracingService(io.micrometer.tracing.Tracer tracer, io.micrometer.tracing.propagation.Propagator propagator) -
Method Summary
Modifier and TypeMethodDescriptiontraceOutboxRecordProcessing(OutboxRecord outboxRecord) Extracts the tracing headers (as created viaTracingService.tracingHeadersForOutboxRecord()) from the outbox record to create a span for the time spent in the outbox.
A new span is started for the processing and publishing to Kafka, and headers to publish to Kafka are returned.Extracts the tracing headers from the current context and returns them as a map.
-
Constructor Details
-
MicrometerTracingService
public MicrometerTracingService(io.micrometer.tracing.Tracer tracer, io.micrometer.tracing.propagation.Propagator propagator)
-
-
Method Details
-
tracingHeadersForOutboxRecord
Description copied from interface:TracingServiceExtracts the tracing headers from the current context and returns them as a map. If tracing is not active, an empty map is returned.This is meant to be used when creating an outbox record, to store the tracing headers with the record.
- Specified by:
tracingHeadersForOutboxRecordin interfaceTracingService
-
traceOutboxRecordProcessing
public TracingService.TraceOutboxRecordProcessingResult traceOutboxRecordProcessing(OutboxRecord outboxRecord) Description copied from interface:TracingServiceExtracts the tracing headers (as created viaTracingService.tracingHeadersForOutboxRecord()) from the outbox record to create a span for the time spent in the outbox.
A new span is started for the processing and publishing to Kafka, and headers to publish to Kafka are returned. The span must be completed once the message is published to Kafka.- Specified by:
traceOutboxRecordProcessingin interfaceTracingService
-