admin管理员组

文章数量:1406728

I have spring boot 3.4 application configured for metrics.

  1. I've added dependencies:
    implementation("io.micrometer:micrometer-tracing-bridge-otel")
    implementation("io.opentelemetry:opentelemetry-exporter-zipkin")

to my build.gradle.kts

  1. added annotation @Observed on some methods

  2. added to application.yaml:

management:
  tracing:
    sampling:
      probability: 1
  1. Also I've started Zipkin using following docker compose file:
version: '2.4'

services:
  # The zipkin process services the UI, and also exposes a POST endpoint that
  # instrumentation can send trace data to.
  zipkin:
    image: ghcr.io/openzipkin/zipkin-slim:${TAG:-latest}
    container_name: zipkin
    # Environment settings are defined here .md#environment-variables
    environment:
      - STORAGE_TYPE=mem
      # Uncomment to enable self-tracing
      # - SELF_TRACING_ENABLED=true
      # Uncomment to increase heap size
      # - JAVA_OPTS=-Xms128m -Xmx128m -XX:+ExitOnOutOfMemoryError
    ports:
      # Port used for the Zipkin UI and HTTP Api
      - 9411:9411
    # Uncomment to enable debug logging
    # command: --logging.level.zipkin2=DEBUG

Everything is working and I see traces/spans in zipkin web ui but I have a question:

Is it possible to save traces locally without sending them to zipkin ui ?

Could I use different transport to send them to zipkin ?

I have spring boot 3.4 application configured for metrics.

  1. I've added dependencies:
    implementation("io.micrometer:micrometer-tracing-bridge-otel")
    implementation("io.opentelemetry:opentelemetry-exporter-zipkin")

to my build.gradle.kts

  1. added annotation @Observed on some methods

  2. added to application.yaml:

management:
  tracing:
    sampling:
      probability: 1
  1. Also I've started Zipkin using following docker compose file:
version: '2.4'

services:
  # The zipkin process services the UI, and also exposes a POST endpoint that
  # instrumentation can send trace data to.
  zipkin:
    image: ghcr.io/openzipkin/zipkin-slim:${TAG:-latest}
    container_name: zipkin
    # Environment settings are defined here https://github/openzipkin/zipkin/blob/master/zipkin-server/README.md#environment-variables
    environment:
      - STORAGE_TYPE=mem
      # Uncomment to enable self-tracing
      # - SELF_TRACING_ENABLED=true
      # Uncomment to increase heap size
      # - JAVA_OPTS=-Xms128m -Xmx128m -XX:+ExitOnOutOfMemoryError
    ports:
      # Port used for the Zipkin UI and HTTP Api
      - 9411:9411
    # Uncomment to enable debug logging
    # command: --logging.level.zipkin2=DEBUG

Everything is working and I see traces/spans in zipkin web ui but I have a question:

Is it possible to save traces locally without sending them to zipkin ui ?

Could I use different transport to send them to zipkin ?

Share Improve this question asked Mar 4 at 15:33 gstackoverflowgstackoverflow 36.6k138 gold badges419 silver badges786 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Is it possible to save traces locally without sending them to zipkin ui ?

Yes, you can implement an exporter to write the data to disk.

Could I use different transport to send them to zipkin ?

Yes, you can implement an exporter to use whatever transport Zipkin supports.

本文标签: spring bootIs there way to persist traces on a disk instead of sending them to ZipkinStack Overflow