我只能找到将opentracing/jaeger与kafka结合使用的古老而不完整的例子。我想在本地运行一个示例作为概念证明—opentracing跨越到kafka。
我设法让一些工作,但 jeager-query
我一直得到的服务:
"msg":"Failed to init storage factory","error":"kafka: client has run out of available brokers to talk to (Is your cluster reachable?)"
我不确定我是否需要使用某种存储,比如Cassandra?
version: '3.8'
services:
zookeeper:
image: confluentinc/cp-zookeeper
networks:
- kafka-net
container_name: zookeeper
environment:
- ZOOKEEPER_CLIENT_PORT=2181
ports:
- 2181:2181
kafka:
image: confluentinc/cp-kafka
networks:
- kafka-net
container_name: kafka
environment:
- KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181
- KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1
- ALLOW_PLAINTEXT_LISTENER=yes
- KAFKA_LISTENERS-INTERNAL://kafka:29092,EXTERNAL://localhost:9092
- KAFKA_ADVERTISED=INTERNAL://kafka:29092,EXTERNAL://localhost:9092
- KAFKA_ADVERTISED_LISTENERS=INTERNAL://kafka:29092,EXTERNAL://localhost:9092
- KAFKA_LISTENER_SECURITY_PROTOCOL_MAP=INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT
- KAFKA_INTER_BROKER_LISTENER_NAME=INTERNAL
ports:
- 9092:9092
depends_on:
- zookeeper
restart: on-failure
jaeger-collector:
image: jaegertracing/jaeger-collector
container_name: jaeger-collector
networks:
- kafka-net
ports:
- "14250:14250"
# - "14267:14267"
- "14268:14268" # HTTP collector port to receive spans
- "14269:14269" # HTTP health check port
restart: on-failure
environment:
LOG_LEVEL: "debug"
SPAN_STORAGE_TYPE: "kafka"
KAFKA_TOPIC: "somekafkatag"
KAFKA_BROKERS: "kafka:9092"
KAFKA_PRODUCER_BROKERS: "kafka:29092"
jaeger-agent:
image: jaegertracing/jaeger-agent
container_name: jaeger-agent
networks:
- kafka-net
command: ["--reporter.grpc.host-port=jaeger-collector:14250"]
ports:
- "5775:5775/udp"
- "6831:6831/udp"
- "6832:6832/udp"
- "5778:5778"
environment:
LOG_LEVEL: "debug"
SPAN_STORAGE_TYPE: "kafka"
restart: on-failure
depends_on:
- jaeger-collector
jaeger-ingester:
image: jaegertracing/jaeger-ingester
container_name: jaeger-ingester
networks:
- kafka-net
ports:
- "14270:14270" # HTTP health check port: http://localhost:14270/
- "14271:14271" # Metrics port: http://localhost:14271/metrics
restart: on-failure
command: ["--kafka.producer.brokers=kafka:9092"]
environment:
LOG_LEVEL: "debug"
INGESTER_PARALLELISM: "1"
INGESTER_DEADLOCKINTERVAL: "0ms"
SPAN_STORAGE_TYPE: "kafka"
KAFKA_CONSUMER_BROKERS: "kafka:9092"
METRICS_BACKEND: "expvar"
KAFKA_BROKERS: "kafka:29092"
jaeger-query:
image: jaegertracing/jaeger-query
container_name: jaeger-query
networks:
- kafka-net
ports:
- "16686:16686" # Jaeger UI port
- "16687:16687" # HTTP health check port: http://localhost:16687/
restart: on-failure
environment:
LOG_LEVEL: "debug"
SPAN_STORAGE_TYPE: "kafka"
KAFKA_CONSUMER_BROKERS: "kafka:9092"
KAFKA_BROKERS: "kafka:29092"
networks:
kafka-net:
driver: bridge
2条答案
按热度按时间raogr8fs1#
您可以看到jaeger查询配置包括:span\u storage\u type:“kafka”
该错误表示jaeger查询用于在kafka中存储跨距的kafka客户端实际上无法到达kafka,因此jaeger存储工厂无法初始化。
这可能是因为Kafka启动失败(你检查了吗)?或者你的 Docker 对网络的错误配置。
neekobn82#
我错过了很多信息。我设法让它工作: