0

I am running open-zipkin with docker-compose for testing purposes. The end goal is to have open-zipkin running so that I can successfully do a curl localhost:9411/prometheus on the zipkin container itself and view prometheus metrics. How can I expose the metrics like this?

For reference the zipkin portion of the docker-compose file looks like this:

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
thewooster
  • 807
  • 1
  • 9
  • 23

1 Answers1

0

Maybe, I didn't get your question right, but with almost your docker-compose.yaml file:

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

prometheus metrics are available on localhost:9411/metrics both inside container and on host system:

$ 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}
nickgryg
  • 25,567
  • 5
  • 77
  • 79