我正在尝试设置 Jaeger (v2.1) 以使用 Badger 作为启用存档的后端存储。我已经创建了自己的 Jaeger 映像(由于特定要求,我需要下载 .tar.gz 文件并从那里构建它)。
为了构建我的自定义 docker 映像,我根据
docs准备了
config-badger.yml
。内容如下:
service:
extensions: [jaeger_storage, jaeger_query, healthcheckv2]
pipelines:
traces:
receivers: [otlp, jaeger]
processors: [batch]
exporters: [jaeger_storage_exporter]
telemetry:
resource:
service.name: jaeger
metrics:
level: detailed
address: 0.0.0.0:8888
logs:
level: info
# TODO Initialize telemetry tracer once OTEL released new feature.
# https://github.com/open-telemetry/opentelemetry-collector/issues/10663
extensions:
healthcheckv2:
use_v2: true
http: # The HTTP health check endpoint (13133)
jaeger_query:
storage:
traces: requests_store
traces_archive: archive_store
ui:
config_file: /etc/jaeger/config-ui.json
jaeger_storage:
backends:
requests_store:
badger:
directories:
keys: "/tmp/jaeger/"
values: "/tmp/jaeger/"
ephemeral: false
consistency: true
maintenance_interval: 1m0s
archive_store:
badger:
directories:
keys: "/tmp/jaeger_archive/"
values: "/tmp/jaeger_archive/"
ephemeral: false
consistency: true
maintenance_interval: 2m0s
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317 # Bind to all network interfaces
http:
endpoint: 0.0.0.0:4318 # Bind to all network interfaces
jaeger:
protocols:
thrift_compact:
endpoint: 0.0.0.0:6831 # Bind to all network interfaces
processors:
batch:
exporters:
jaeger_storage_exporter:
trace_storage: requests_store
dockerfile 中指向配置的最后一行是:
CMD ["./jaeger", "--config", "/etc/jaeger/config-badger.yaml"]
我已在本地注册表中以
custom-jaeger:2.1
的名称构建了该映像。
这是我的
docker-compose-v2.yml
(我还设置了 HotRod
应用程序以将跟踪发送到本地 jaeger 实例):
services:
jaeger:
image: custom-jaeger:2.1
ports:
- "16686:16686"
- "6831:6831"
- "4317:4317"
- "4318:4318"
environment:
- LOG_LEVEL=debug
networks:
- jaeger-example
hotrod:
image: ${REGISTRY:-}jaegertracing/example-hotrod:${HOTROD_VERSION:-latest}
ports:
- "8080:8080"
- "8083:8083"
command: ["all"]
environment:
- OTEL_EXPORTER_OTLP_ENDPOINT=http://jaeger:4318 # For exporting traces
- JAEGER_HTTP_HOST=jaeger:16686 # This allows Hot Rod to find traces on the Web UI
networks:
- jaeger-example
depends_on:
- jaeger
networks:
jaeger-example:
但是,由于某种原因,我总是收到错误(
docker compose -f docker-compose-v2.yml up
):
jaeger-all-in-one-jaeger-1 | 2024-12-09T18:39:46.078Z info jaegerquery/server.go:142 Archive storage not initialized {"kind": "extension", "name": "jaeger_query"}
尝试启用存档时。
除此之外,一切正常。我可以使用
HotRod
应用程序发送痕迹,并使用 Jaeger 的本地实例查看它们。但是我无法修复存档部分。我尝试在 docker-compose 中使用 tmpfs
和 volumes
,但错误是相同的。 config-badger.yml
的示例配置表明应该支持它,但这些文档到处都是,说实话,找到我正在寻找的答案并不容易。
我错过了什么?
这是一个错误。请在 Jaeger 中打开一个问题。从日志中:
Archive storage not supported by the factory
Archive storage not initialized