Class OpenTelemetryEventPublisherBeansApplicationListener
java.lang.Object
org.springframework.boot.actuate.autoconfigure.tracing.OpenTelemetryEventPublisherBeansApplicationListener
- All Implemented Interfaces:
EventListener,org.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent>,org.springframework.context.event.GenericApplicationListener,org.springframework.context.event.SmartApplicationListener,org.springframework.core.Ordered
public class OpenTelemetryEventPublisherBeansApplicationListener
extends Object
implements org.springframework.context.event.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
- See Also:
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidAddtheContextStoragewrapper to ensure thatEventPublishersare propagated correctly.intgetOrder()voidonApplicationEvent(org.springframework.context.ApplicationEvent event) booleansupportsEventType(org.springframework.core.ResolvableType eventType) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.ApplicationListener
supportsAsyncExecutionMethods inherited from interface org.springframework.context.event.GenericApplicationListener
supportsEventTypeMethods inherited from interface org.springframework.context.event.SmartApplicationListener
getListenerId, supportsSourceType
-
Constructor Details
-
OpenTelemetryEventPublisherBeansApplicationListener
public OpenTelemetryEventPublisherBeansApplicationListener()
-
-
Method Details
-
getOrder
public int getOrder()- Specified by:
getOrderin interfaceorg.springframework.core.Ordered- Specified by:
getOrderin interfaceorg.springframework.context.event.SmartApplicationListener
-
supportsEventType
public boolean supportsEventType(org.springframework.core.ResolvableType eventType) - Specified by:
supportsEventTypein interfaceorg.springframework.context.event.GenericApplicationListener
-
onApplicationEvent
public void onApplicationEvent(org.springframework.context.ApplicationEvent event) - Specified by:
onApplicationEventin interfaceorg.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent>
-
addWrapper
public static void addWrapper()AddtheContextStoragewrapper to ensure thatEventPublishersare propagated correctly.
-