【发布时间】:2019-10-05 15:42:47
【问题描述】:
我们正在使用 Micronaut (v1.2.0) 构建一个 Web 应用程序,该应用程序将部署在 Kubernetes 集群中(我们使用 Istio 作为服务网格)。
我们希望检测关键方法调用,以便它们可以在 HTTP 请求跨度上下文中生成自己的跨度。为此,我们使用了 Micronaut OpenTracing 支持和 Jaeger 集成。
pom.xml中包含以下依赖项
...
<dependency>
<groupId>io.micronaut</groupId>
<artifactId>micronaut-tracing</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.jaegertracing</groupId>
<artifactId>jaeger-thrift</artifactId>
<scope>runtime</scope>
</dependency>
...
已经用@ContinueSpan实现了Filter方法(也尝试了@NewSpan),如下所示
@Filter("/**")
public class TraceTestFilter implements HttpServerFilter {
@Override
public Publisher<MutableHttpResponse<?>> doFilter(
HttpRequest<?> request, ServerFilterChain chain) {
return testMethodTracing(request, chain);
}
@ContinueSpan
public Publisher<MutableHttpResponse<?>> testMethodTracing(
HttpRequest<?> request, ServerFilterChain chain) {
// Details ommitted here
}
}
以下维护在application-k8s.yml中(也有一个application.yml具有相同的设置)
---
tracing:
jaeger:
enabled: true
sampler:
probability: 1
sender:
agentHost: jaeger-agent.istio-system
agentPort: 5775
但是,我们只看到由 Istio(Envoy 代理)生成的跟踪条目,而看不到方法调用本身的详细信息。
关于这里可能出现什么问题的任何想法?
【问题讨论】:
标签: istio micronaut opentracing jaeger