【问题标题】:Opentelemetry with Zipkin exporter is not working as expected. Throws StatusRuntimeException: UNAVAILABLE: io exception使用 Zipkin 导出器的 Opentelemetry 未按预期工作。抛出 StatusRuntimeException: UNAVAILABLE: io 异常
【发布时间】:2021-06-05 15:07:17
【问题描述】:

我对使用 OpenTelemetry 非常陌生,刚刚尝试将其配置为将跟踪信息发送到我的 Zipkin 服务器。不幸的是,在通过指定 zipkin 导出器详细信息配置代理后,我可以在控制台中看到异常。我使用 Petclic 作为示例弹簧靴,并遵循此处的文档https://github.com/open-telemetry/opentelemetry-java-instrumentation

这是我用来启动 spring-boot 应用程序的命令(我的 zipkin 服务器在 localhost:9411 运行):

java -javaagent:opentelemetry-javaagent-all.jar -Dotel.exporter=zipkin -Dotel.exporter.zipkin.endpoint=localhost:9411 -jar spring-petclinic-2.4.2.jar

控制台出现异常(它试图连接到 gRpc 导出器而不是 Zipkins):

[opentelemetry.auto.trace 2021-03-07 20:24:15:582 +0530] [IntervalMetricReader-1] WARN io.opentelemetry.expor**ter.otlp.metrics.OtlpGrpcMetricExporter - Failed to export metrics
io.grpc.StatusRuntimeException: UNAVAILABLE: io exception**
        at io.grpc.Status.asRuntimeException(Status.java:534)
        at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:533)
        at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:617)
        at io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:70)
        at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:803)
        at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:782)
        at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
        at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: no further information: **localhost/0:0:0:0:0:0:0:1:4317**
Caused by: java.net.ConnectException: Connection refused: no further information

请你告诉我这有什么问题。

编辑: 我已经尝试通过 -Dotel.traces.exporter=zipkin 而不是 -Dotel.exporter=zipkin 但没有成功。我只是想通过将这些参数作为 jvm 参数传递来通过 Eclipse 启动我的 Spring Boot 应用程序。 OpenTelemetery 上的每个教程似乎都在使用 Docker 设置。请有人帮忙

【问题讨论】:

    标签: zipkin open-telemetry


    【解决方案1】:

    我有同样的问题,但我用这个 jvm 参数解决了:

    -Dotel.traces.exporter=zipkin -Dotel.metrics.exporter=none -Dotel.exporter.zipkin.endpoint=http://localhost:9411/api/v2/spans 可能错误在 zipkin.endpoint 上,尝试写下整个 url。

    问候, 马可

    【讨论】:

    • 非常感谢,它就像一个魅力!我使用了您提供的确切命令,它运行良好,再次感谢。
    【解决方案2】:

    请在您的命令中尝试以下 -Dotel.traces.exporter=zipkin 而不是 -Dotel.exporter=zipkin

    【讨论】:

    • 您好 Sundhar,非常感谢您抽出宝贵时间对此发表评论。我已经尝试提供 -Dotel.traces.exporter=zipkin 而不是 Dotel.exporter=zipkin 并且没有成功。仅供参考,我没有 docker 设置,也没有在 docker yaml 中将这些作为参数传递。我只是想通过将这些参数作为 jvm 参数传递来启动我的 Spring Boot 应用程序。
    猜你喜欢
    • 2017-08-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-06-19
    • 2014-09-18
    • 1970-01-01
    • 2011-03-11
    相关资源
    最近更新 更多