Class OpenTelemetryEventPublisherBeansApplicationListener
java.lang.Object
org.springframework.boot.actuate.autoconfigure.tracing.OpenTelemetryEventPublisherBeansApplicationListener
- All Implemented Interfaces:
EventListener
,ApplicationListener<ApplicationEvent>
,GenericApplicationListener
,SmartApplicationListener
,Ordered
public class OpenTelemetryEventPublisherBeansApplicationListener
extends Object
implements GenericApplicationListener
ApplicationListener
to add an OpenTelemetry ContextStorage
wrapper for
OtelTracer.EventPublisher
bean support. A single ContextStorage
wrapper is added
on the ApplicationStartingEvent
then updated with OtelTracer.EventPublisher
beans
as needed.
The addWrapper()
method may also be called directly if the
ApplicationStartingEvent
isn't called early enough or isn't fired.
- Since:
- 3.4.0
- Author:
- Phillip Webb
- See Also:
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Add
theContextStorage
wrapper to ensure thatEventPublishers
are propagated correctly.int
getOrder()
void
boolean
supportsEventType
(ResolvableType eventType) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.context.ApplicationListener
supportsAsyncExecution
Methods inherited from interface org.springframework.context.event.GenericApplicationListener
supportsEventType
Methods inherited from interface org.springframework.context.event.SmartApplicationListener
getListenerId, supportsSourceType
-
Constructor Details
-
OpenTelemetryEventPublisherBeansApplicationListener
public OpenTelemetryEventPublisherBeansApplicationListener()
-
-
Method Details
-
getOrder
public int getOrder()- Specified by:
getOrder
in interfaceOrdered
- Specified by:
getOrder
in interfaceSmartApplicationListener
-
supportsEventType
- Specified by:
supportsEventType
in interfaceGenericApplicationListener
-
onApplicationEvent
- Specified by:
onApplicationEvent
in interfaceApplicationListener<ApplicationEvent>
-
addWrapper
public static void addWrapper()Add
theContextStorage
wrapper to ensure thatEventPublishers
are propagated correctly.
-