-
Notifications
You must be signed in to change notification settings - Fork 0
/
TraceConfiguration.java
33 lines (27 loc) · 1.05 KB
/
TraceConfiguration.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package com.spring.service.userservice.config;
import io.micrometer.tracing.Tracer;
import io.micrometer.tracing.annotation.*;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class TraceConfiguration {
@Bean
SpanAspect spanAspect(MethodInvocationProcessor methodInvocationProcessor) {
return new SpanAspect(methodInvocationProcessor);
}
@Bean
MethodInvocationProcessor methodInvocationProcessor(NewSpanParser newSpanParser,
Tracer tracer,
BeanFactory beanFactory) {
return new ImperativeMethodInvocationProcessor(
newSpanParser,
tracer,
beanFactory::getBean,
beanFactory::getBean);
}
@Bean
NewSpanParser newSpanParser() {
return new DefaultNewSpanParser();
}
}