Class OpentracingResponseFilter
- java.lang.Object
-
- org.springframework.web.filter.GenericFilterBean
-
- org.hawaiiframework.logging.web.filter.AbstractGenericFilterBean
-
- org.hawaiiframework.logging.opentracing.OpentracingResponseFilter
-
- All Implemented Interfaces:
EventListener
,javax.servlet.Filter
,org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanNameAware
,org.springframework.beans.factory.DisposableBean
,org.springframework.beans.factory.InitializingBean
,org.springframework.context.ApplicationContextAware
,org.springframework.context.ApplicationListener<org.springframework.boot.context.event.ApplicationReadyEvent>
,org.springframework.context.EnvironmentAware
,org.springframework.core.env.EnvironmentCapable
,org.springframework.web.context.ServletContextAware
public class OpentracingResponseFilter extends AbstractGenericFilterBean implements org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener<org.springframework.boot.context.event.ApplicationReadyEvent>
A filter that adds the trace id to the response header.The filter uses the configured tracer's ability to inject itself into HTTP header fields. So whatever is configured for propagating the tracer's context, is used here as well. This allows switching between, for instance Jaeger and Zipkin format.
- Since:
- 3.0.0.M11
- Author:
- Rutger Lubbers
-
-
Constructor Summary
Constructors Constructor Description OpentracingResponseFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doFilterInternal(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.FilterChain filterChain)
Same contract as fordoFilter
.void
onApplicationEvent(org.springframework.boot.context.event.ApplicationReadyEvent event)
void
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
-
Methods inherited from class org.hawaiiframework.logging.web.filter.AbstractGenericFilterBean
doFilter
-
-
-
-
Method Detail
-
doFilterInternal
protected void doFilterInternal(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.FilterChain filterChain) throws javax.servlet.ServletException, IOException
Same contract as fordoFilter
.- Specified by:
doFilterInternal
in classAbstractGenericFilterBean
- Throws:
javax.servlet.ServletException
IOException
-
setApplicationContext
public void setApplicationContext(@NonNull org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
- Specified by:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
- Throws:
org.springframework.beans.BeansException
-
onApplicationEvent
public void onApplicationEvent(@NonNull org.springframework.boot.context.event.ApplicationReadyEvent event)
- Specified by:
onApplicationEvent
in interfaceorg.springframework.context.ApplicationListener<org.springframework.boot.context.event.ApplicationReadyEvent>
-
-