【问题标题】:quarkus reactive-postgresql-client with jaeger opentracing support具有 jaeger opentracing 支持的 quarkus reactive-postgresql-client
【发布时间】:2019-11-27 18:22:10
【问题描述】:

基于thisthis

如何启用reactive-sql-clients 的跟踪?

现在使用%dev.quarkus.datasource.url=vertx-reactive:postgresql://dev-db-server:5432/mydb - 它可以工作,但不支持跟踪。我可以看到我的休息电话比赛,但看不到分贝。

尝试使用%dev.quarkus.datasource.url=vertx-reactive:tracing:postgresql://dev-db-server:5432/mydb

我的部门:

<dependency>
  <groupId>io.quarkus</groupId>
  <artifactId>quarkus-smallrye-openapi</artifactId>
</dependency>

<dependency>
  <groupId>io.quarkus</groupId>
  <artifactId>quarkus-agroal</artifactId>
</dependency>

<dependency>
  <groupId>io.quarkus</groupId>
  <artifactId>quarkus-reactive-pg-client</artifactId>
</dependency>

【问题讨论】:

    标签: quarkus opentracing jaeger


    【解决方案1】:

    我明白了..

    我认为 @Traced 会以某种方式传播到我的数据库服务/存储库。不,我必须明确地说:

    import org.eclipse.microprofile.opentracing.Traced;
    
    @Traced        // << -- here it is
    @Singleton
    public class MarketPgRepository implements MarketRepository {
    
        @Inject
        PgPool client;
    

    这解决了问题。

    【讨论】:

    • 默认情况下,只有 JAX-RS 资源方法隐含了 @Traced,所有其他方法都需要显式包含它。至少现在
    猜你喜欢
    • 2020-11-09
    • 2022-06-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-06-14
    • 1970-01-01
    相关资源
    最近更新 更多