Skip to content

Instantly share code, notes, and snippets.

@tung1404
Forked from wshihadeh/opentracing.yaml
Created August 2, 2023 03:13
Show Gist options
  • Save tung1404/3ac8d90c48c7bb984859f9a67f35a33f to your computer and use it in GitHub Desktop.
Save tung1404/3ac8d90c48c7bb984859f9a67f35a33f to your computer and use it in GitHub Desktop.
Tarefik opentracing
version: '3.7'
networks:
traefik:
external: true
services:
pink:
image: emilevauge/whoami
environment:
APP_COLOR: 'pink'
deploy:
labels:
- traefik.enable=true
- traefik.http.services.pink.loadbalancer.server.port=80
- traefik.http.routers.pink.rule=Host(`pink.wshihadeh.cloud`)
- traefik.http.routers.pink.service=pink
- traefik.http.routers.pink.entrypoints=web
- traefik.docker.network=traefik
restart_policy:
condition: any
delay: 5s
max_attempts: 3
window: 120s
update_config:
delay: 10s
order: start-first
parallelism: 1
rollback_config:
parallelism: 0
order: stop-first
networks:
- traefik
blue:
image: wshihadeh/whoami:soso
environment:
APP_COLOR: 'blue'
deploy:
labels:
- traefik.enable=true
- traefik.http.services.blue.loadbalancer.server.port=8080
- traefik.http.routers.blue.rule=Host(`blue.wshihadeh.cloud`)
- traefik.http.routers.blue.service=blue
- traefik.http.routers.blue.entrypoints=web
- traefik.docker.network=traefik
restart_policy:
condition: any
delay: 5s
max_attempts: 3
window: 120s
update_config:
delay: 10s
order: start-first
parallelism: 1
rollback_config:
parallelism: 0
order: stop-first
networks:
- traefik
zipkin:
image: openzipkin/zipkin
deploy:
labels:
- traefik.enable=true
- traefik.http.services.zipkin.loadbalancer.server.port=9411
- traefik.http.routers.zipkin.rule=Host(`zipkin.wshihadeh.cloud`)
- traefik.http.routers.zipkin.service=zipkin
- traefik.http.routers.zipkin.entrypoints=web
- traefik.docker.network=traefik
restart_policy:
condition: any
delay: 5s
max_attempts: 3
window: 120s
update_config:
delay: 10s
order: start-first
parallelism: 1
rollback_config:
parallelism: 0
order: stop-first
networks:
- traefik
jaegertracing:
image: jaegertracing/all-in-one:latest
ports:
- 9411:9411
- 16686:16686
environment:
COLLECTOR_ZIPKIN_HTTP_PORT: 9411
deploy:
labels:
- traefik.enable=true
- traefik.http.services.jaeger.loadbalancer.server.port=16686
- traefik.http.routers.jaeger.rule=Host(`jaeger.wshihadeh.cloud`)
- traefik.http.routers.jaeger.service=jaeger
- traefik.http.routers.jaeger.entrypoints=web
- traefik.docker.network=traefik
restart_policy:
condition: any
delay: 5s
max_attempts: 3
window: 120s
update_config:
delay: 10s
order: start-first
parallelism: 1
rollback_config:
parallelism: 0
order: stop-first
networks:
- traefik
proxy:
image: traefik:v2.2
command:
- '--log.level=DEBUG'
- '--providers.docker=true'
- '--entryPoints.web.address=:80'
- '--entryPoints.metrics.address=:8082'
- '--providers.providersThrottleDuration=2s'
- '--providers.docker.watch=true'
- '--providers.docker.swarmMode=true'
- '--providers.docker.swarmModeRefreshSeconds=15s'
- '--providers.docker.exposedbydefault=false'
- '--providers.docker.defaultRule=Host("wshihadeh.cloud")'
- '--api=true'
- '--api.dashboard=true'
- '--api.insecure=true'
- '--ping.entryPoint=web'
- '--accesslog=true'
- '--accessLog.bufferingSize=0'
- '--accesslog.format=json'
- '--accesslog.fields.defaultmode=keep'
- '--accesslog.fields.names.ClientUsername=keep'
- '--accesslog.fields.headers.defaultmode=keep'
- '--tracing.serviceName=traefik'
- '--tracing.spanNameLimit=250'
- '--tracing.jaeger=true'
- '--tracing.jaeger.samplingServerURL=http://jaegertracing:5778/sampling'
- '--tracing.jaeger.samplingType=const'
- '--tracing.jaeger.samplingParam=1'
- '--tracing.jaeger.localAgentHostPort=127.0.0.1:6831'
- '--tracing.jaeger.gen128Bit'
- '--tracing.jaeger.propagation=jaeger'
- '--tracing.jaeger.traceContextHeaderName=uber-trace-id'
- '--tracing.jaeger.collector.endpoint=http://jaegertracing:14268/api/traces?format=jaeger.thrift'
# - '--tracing.jaeger.collector.user=my-user'
# - '--tracing.jaeger.collector.password=my-password'
# - '--tracing.zipkin=true'
# - '--tracing.zipkin.httpEndpoint=http://zipkin:9411/api/v2/spans'
# - '--tracing.zipkin.sameSpan=true'
# - '--tracing.zipkin.id128Bit=true'
# - '--tracing.zipkin.sampleRate=1'
volumes:
- '/var/run/docker.sock:/var/run/docker.sock:ro'
ports:
- '80:80'
- '8080:8080'
deploy:
labels:
- traefik.enable=true
- traefik.docker.network=traefik
# Dashboard Router
- traefik.http.services.traefik-dashboard.loadbalancer.server.port=8080
- traefik.http.routers.traefik-dashboard.rule=Host(`dashboard.wshihadeh.cloud`)
- traefik.http.routers.traefik-dashboard.service=traefik-dashboard
- traefik.http.routers.traefik-dashboard.entrypoints=web
restart_policy:
condition: any
delay: 5s
max_attempts: 3
window: 120s
update_config:
delay: 10s
order: start-first
parallelism: 1
rollback_config:
parallelism: 0
order: stop-first
logging:
driver: json-file
options:
'max-size': '10m'
'max-file': '5'
networks:
- traefik
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment