Skip to content

Instantly share code, notes, and snippets.

@rsrini7
Created March 10, 2024 12:49
Show Gist options
  • Save rsrini7/600f9ac42b24cad0c38da5e923395994 to your computer and use it in GitHub Desktop.
Save rsrini7/600f9ac42b24cad0c38da5e923395994 to your computer and use it in GitHub Desktop.
otel context propagation
https://www.dynatrace.com/news/blog/distributed-tracing-with-w3c-trace-context-for-improved-end-to-end-visibility/
https://engineering.dynatrace.com/open-source/standards/w3c-trace-context/
https://aloisreitbauer.medium.com/trace-context-and-the-road-toward-trace-tool-interoperability-d4d56932369c
https://stackoverflow.com/questions/76620276/use-both-b3-and-w3c-trace-formats-in-trace-propagation-between-spring-boot-2-3
b3 to use the concatenated b3: {TraceId}-{SpanId}-{SamplingState}-{ParentSpanId} header
b3_multi to use separate headers such as X-B3-SpanId and X-B3-TraceId
w3c to use the traceparent header
--------
https://github.com/davidmelia/spring-boot3-remote-baggage/blob/5aa0d389ffffa0790df67f7a62500ad63585bcbf/remotebaggage-boot3.0/src/main/java/com/example/demo/controller/AddressController.java
https://github.com/davidmelia/spring-boot3-remote-baggage/blob/5aa0d389ffffa0790df67f7a62500ad63585bcbf/remotebaggage-boot3.0/src/test/java/com/example/demo/MicroserviceBApplicationTests.java
logging.pattern.level=%5p [aid=${spring.application.name:-},tid=%X{traceId:-},sid=%X{spanId:-},cusname=%X{Customer-Name:-}]
management.tracing.baggage.correlation.fields=Customer-Name
management.tracing.baggage.remote-fields=Customer-Name
management.tracing.baggage.enabled=true
management.tracing.propagation.type=w3c
management.tracing.sampling.probability=1.0
spring.cloud.stream.kafka.binder.enable-observation=true
spring.kafka.listener.observation-enabled=true
spring.kafka.template.observation-enabled=true
------
# Metrics
management.endpoints.web.path-mapping.prometheus=metrics/prometheus
management.metrics.web.server.request.autotime.enabled=true
management.endpoint.prometheus.enabled=true
management.endpoint.metrics.enabled=true
management.endpoint.health.group.readiness.include=readinessState, mongo, openPolicyAgent, kafka
management.endpoint.health.validate-group-membership=false
management.endpoint.health.show-details=always
management.endpoint.health.show-components=always
management.tracing.enabled=true
management.tracing.propagation.type=b3,w3c
management.tracing.sampling.probability=1.0
management.otlp.tracing.endpoint=http://grafana-agent-traces.monitoring:4317
management.otlp.tracing.compression=none
management.otlp.tracing.timeout=10s
management.tracing.grpc.enabled=true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment