Skip to content

Instantly share code, notes, and snippets.

@hartmannr76
Created May 22, 2018 13:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hartmannr76/4fa643241e687646b38a7f7e11da03af to your computer and use it in GitHub Desktop.
Save hartmannr76/4fa643241e687646b38a7f7e11da03af to your computer and use it in GitHub Desktop.
Egress tracing for calling to external service
version: '2'
services:
sample-app:
build:
context: .
volumes:
- ./service-envoy.yaml:/etc/service-envoy.yaml
ports:
- "8081:8081"
expose:
- "8081"
zipkin:
image: openzipkin/zipkin
container_name: zipkin
ports:
- 9411:9411
FROM envoyproxy/envoy:latest as proxy
RUN apt-get update
RUN apt-get -y install curl
CMD /usr/local/bin/envoy -c /etc/service-envoy.yaml --service-cluster servicemain
static_resources:
listeners:
- address:
socket_address:
address: 0.0.0.0
port_value: 9000
filter_chains:
- filters:
- name: envoy.http_connection_manager
config:
tracing:
operation_name: egress
codec_type: auto
stat_prefix: egress_http
route_config:
name: httpbin_route
virtual_hosts:
- name: httpbin_service
domains:
- "*"
routes:
- match:
prefix: "/"
route:
cluster: httpbin_service
host_rewrite: www.httpbin.org
decorator:
operation: checkStock
http_filters:
- name: envoy.router
config: {}
clusters:
- name: httpbin_service
connect_timeout: 2.5s
type: LOGICAL_DNS
dns_lookup_family: V4_ONLY
lb_policy: round_robin
hosts:
- socket_address:
address: httpbin.org
port_value: 443
tls_context: { sni: www.httpbin.org }
- name: zipkin
connect_timeout: 1s
type: strict_dns
lb_policy: round_robin
hosts:
- socket_address:
address: zipkin
port_value: 9411
tracing:
http:
name: envoy.zipkin
config:
collector_cluster: zipkin
collector_endpoint: "/api/v1/spans"
admin:
access_log_path: "/dev/null"
address:
socket_address:
address: 0.0.0.0
port_value: 8081
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment