dremio + grafana/tempo opentelemetry监控集成

昨天我写过一个基于signoz的dremio opentelemetry 集成,实际上grafana/tempo 也是一个很不错的选择,主要是部署简单,以下是一个简单测试

环境准备

  • docker-compose 文件
version: "3"
services:
  tempo:
    image: grafana/tempo:latest
    command: [ "-config.file=/etc/tempo.yaml" ]
    volumes:
      - ./tempo/tempo-s3.yaml:/etc/tempo.yaml
      - ./tempo/tempo-data:/tmp/tempo
    ports:
      - "14268:14268"      # jaeger
      - "4317:4317"
      - "4318:4318"
      - "9411:9411"
      - "3200:3200"  # tempo
  minio:
    image: minio/minio:latest
    environment:
      - MINIO_ACCESS_KEY=minio
      - MINIO_SECRET_KEY=minio123
    ports:
      - "9001:9001"
      - "9000:9000"
    entrypoint:
      - sh
      - -euc
      - mkdir -p /data/tempo && minio server /data --console-address ':9001'
  prometheus:
    image: prom/prometheus:latest
    command:
      - --config.file=/etc/prometheus.yaml
      - --web.enable-remote-write-receiver
      - --enable-feature=exemplar-storage
    volumes:
      - ./tempo/prometheus.yaml:/etc/prometheus.yaml
    ports:
      - "9090:9090"
  grafana:
    image: grafana/grafana:10.1.1
    volumes:
      - ./tempo/grafana-datasources.yaml:/etc/grafana/provisioning/datasources/datasources.yaml
    environment:
      - GF_AUTH_ANONYMOUS_ENABLED=true
      - GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
      - GF_AUTH_DISABLE_LOGIN_FORM=true
      - GF_FEATURE_TOGGLES_ENABLE=traceqlEditor
    ports:
      - "3000:3000"
  dremio:
    build: .
    ports:
       - "9047:9047"
       - "31010:31010"

tempo-s3.yaml

server:
  http_listen_port: 3200
 
distributor:
  receivers:                           # this configuration will listen on all ports and protocols that tempo is capable of.
    jaeger:                            # the receives all come from the OpenTelemetry collector.  more configuration information can
      protocols:                       # be found there: https://github.com/open-telemetry/opentelemetry-collector/tree/main/receiver
        thrift_http:                   #
        grpc:                          # for a production deployment you should only enable the receivers you need!
        thrift_binary:
        thrift_compact:
    zipkin:
    otlp:
      protocols:
        http:
        grpc:
    opencensus:
 
ingester:
  max_block_duration: 5m               # cut the headblock when this much time passes. this is being set for demo purposes and should probably be left alone normally
 
compactor:
  compaction:
    block_retention: 1h                # overall Tempo trace retention. set for demo purposes
 
metrics_generator:
  registry:
    external_labels:
      source: tempo
      cluster: docker-compose
  storage:
    path: /tmp/tempo/generator/wal
    remote_write:
      - url: http://prometheus:9090/api/v1/write
        send_exemplars: true
 
storage:
  trace:
    backend: s3                        # backend configuration to use
    wal:
      path: /tmp/tempo/wal             # where to store the the wal locally
    s3:
      bucket: tempo                    # how to store data in s3
      endpoint: minio:9000
      access_key: minio
      secret_key: minio123
      insecure: true
      # For using AWS, select the appropriate regional endpoint and region
      # endpoint: s3.dualstack.us-west-2.amazonaws.com
      # region: us-west-2
 
overrides:
  metrics_generator_processors: [service-graphs, span-metrics]

dremio-telemetry.yaml 配置

tracing:
  type: opentelemetry
  serviceName: mydremio
  samplerType: on
  collectorEndpoint: http://tempo:4317 # replace with your ip addresss
  # samplerEndpoint: http://localhost:4317
  logSpans: true
  propagator: jaeger

启动&效果

  • 启动
docker-compose up -d
  • 访问

注意需要进行环境的初始化,比如dremio的
grafana 直接支持tempo 的显示 dashboard 地址 http://localhost:3000/explore
效果

说明

如果系统使用grafana 周边比较多的,选择tempo 是挺不错的,而且部署已经使用简单,值得使用,完整配置我已经push github 了,可以参考

参考资料

https://grafana.com/docs/tempo/v2.3.x/
https://github.com/grafana/tempo/tree/main/example/docker-compose
https://github.com/rongfengliang/dremio_opentelemetry_signoz_learning

posted on 2024-01-20 17:53  荣锋亮  阅读(109)  评论(0编辑  收藏  举报

导航