簡體   English   中英

Docker-compose:在Openzipkin上公開Prometheus指標

[英]Docker-compose: Exposing Prometheus metrics on Openzipkin

我正在使用docker -compose運行open-zipkin進行測試。 最終目標是運行zipkin,以便我可以對zipkin容​​器本身成功執行curl localhost:9411/prometheus並查看prometheus指標。 我如何公開這樣的指標?

作為參考,docker-compose文件的zipkin部分如下所示:

services:
storage:
image: openzipkin/zipkin-mysql
container_name: mysql
# Uncomment to expose the storage port for testing
# ports:
#   - 3306:3306

# The zipkin process services the UI, and also exposes a POST endpoint that
# instrumentation can send trace data to. Scribe is disabled by default.
zipkin:
image: openzipkin/zipkin
container_name: zipkin
# Environment settings are defined here https://github.com/openzipkin/zipkin/tree/1.19.0/zipkin-server#environment-variables
environment:
  - STORAGE_TYPE=mysql
  # Point the zipkin at the storage backend
  - MYSQL_HOST=mysql
  # Uncomment to enable scribe
  # - SCRIBE_ENABLED=true
  # Uncomment to enable self-tracing
  # - SELF_TRACING_ENABLED=true
  # Uncomment to enable debug logging
  # - JAVA_OPTS=-Dlogging.level.zipkin=DEBUG -Dlogging.level.zipkin2=DEBUG
ports:
  # Port used for the Zipkin UI and HTTP Api
  - 9411:9411
  # Uncomment if you set SCRIBE_ENABLED=true
  # - 9410:9410
depends_on:
  - storage

也許,我沒有正確回答您的問題,但幾乎使用了docker-compose.yaml文件:

version: '3'
services:
  storage:
    image: openzipkin/zipkin-mysql
    container_name: mysql

  zipkin:
    image: openzipkin/zipkin
    container_name: zipkin
    environment:
      - STORAGE_TYPE=mysql
      - MYSQL_HOST=mysql
    ports:
      - 9411:9411
    depends_on:
      - storage

容器內部和主機系統上的localhost:9411/metrics均提供了prometheus度量標准:

$ curl localhost:9411/metrics
{"counter.zipkin_collector.messages.http":0.0,"counter.zipkin_collector.spans_dropped.http":0.0,"gauge.zipkin_collector.message_bytes.http":0.0,"counter.zipkin_collector.bytes.http":0.0,"gauge.zipkin_collector.message_spans.http":0.0,"counter.zipkin_collector.spans.http":0.0,"counter.zipkin_collector.messages_dropped.http":0.0}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM