OpenTelemetry- 如何调试连接

问题描述 投票:0回答:1

我正在尝试让 OpenTelemetry 容器将 span 传递到我的 Jaeger 容器,但还没有完全弄明白,也不知道哪里出了问题。

我已经确认:

  • 我的应用正在生成跨度并将其传递给 OTel
  • Otel 正在接收跨度

但除此之外,我看不到任何可能表明在导出到 Jaeger 期间发生错误的迹象,但那里从未出现任何跨度。它也很难调试,因为每 10 秒就会输出大量文本,很难滚动浏览并找到重要的位。

奔跑酒店:

/usr/bin/docker run \
  --name oqm_otel \
  -p 1888:1888 \
  -p 8888:8888 \
  -p 8889:8889 \
  -p 13133:13133 \
  -p 4317:4317 \
  -p 4318:4318 \
  -p 55679:55679 \
  -v /etc/oqm/infra/otel/otel-collector-config.yaml:/etc/otel-collector-config.yaml \
  --add-host host.docker.internal:host-gateway \
  otel/opentelemetry-collector:0.72.0

运行 Jaeger:

 /usr/bin/docker run --name oqm_jaeger -p 8090:16686 -p 8091:14268 -d jaegertracing/all-in-one:1

/etc/oqm/infra/otel/otel-collector-config.yaml

# Configuration for OpenTelemetry Collector within the OQM system.
receivers:
  otlp:
    protocols:
      grpc:
        endpoint: otel-collector:4317 # What does this do?

exporters:
  jaeger:
    endpoint: host.docker.internal:8091
    tls:
      insecure: true

processors:
  batch:

extensions:
  health_check:

service:
  extensions: [health_check]
  pipelines:
    traces:
      receivers: [otlp]
      processors: [batch]
      exporters: [jaeger]

登录Otel关于我的请求:

:      -> http.method: Str(GET)
Mar 02 17:55:42 oqm-dev bash[38184]:      -> net.host.port: Int(8080)
Mar 02 17:55:42 oqm-dev bash[38184]:      -> http.response_content_length: Int(5)
Mar 02 17:55:42 oqm-dev bash[38184]: Attributes:
Mar 02 17:55:42 oqm-dev bash[38184]:     Status message :
Mar 02 17:55:42 oqm-dev bash[38184]:     Status code    : Unset
Mar 02 17:55:42 oqm-dev bash[38184]:     End time       : 2023-03-02 22:55:39.869314467 +0000 UTC
Mar 02 17:55:42 oqm-dev bash[38184]:     Start time     : 2023-03-02 22:55:39.810170975 +0000 UTC
Mar 02 17:55:42 oqm-dev bash[38184]:     Kind           : Server
Mar 02 17:55:42 oqm-dev bash[38184]:     Name           : /api/v1/info/currency
Mar 02 17:55:42 oqm-dev bash[38184]:     ID             : 871e3a199b593b47
Mar 02 17:55:42 oqm-dev bash[38184]:     Parent ID      :
Mar 02 17:55:42 oqm-dev bash[38184]:     Trace ID       : 341d0d9ebb77fbc41c90dece6f725571
Mar 02 17:55:42 oqm-dev bash[38184]: Span #0
Mar 02 17:55:42 oqm-dev bash[38184]: InstrumentationScope io.quarkus.opentelemetry
Mar 02 17:55:42 oqm-dev bash[38184]: ScopeSpans SchemaURL:
Mar 02 17:55:42 oqm-dev bash[38184]: ScopeSpans #0

有什么想法吗?

docker docker-networking open-telemetry jaeger
1个回答
0
投票

你的接收器配置看起来很奇怪。我只会使用默认值:

receivers:
  otlp:
    protocols:
      grpc:

调试:

1.) 为跟踪管道启用日志导出器:

    exporters:
      logging:
        verbosity: detailed
...

如果您在收集器日志中看到痕迹,那么您可以假设应用程序->收集器连接正常。

2.) 启用调试日志

service:
  telemetry:
    logs:
      level: "debug"

并检查收集器日志。

3.) 启用和收集收集器指标

https://grafana.com/grafana/dashboards/15983-opentelemetry-collector/ 确保您没有任何出口商排队

© www.soinside.com 2019 - 2024. All rights reserved.