Last active
February 10, 2024 07:26
-
-
Save ofek/6051508cd0dfa98fc6c13153b647c6f8 to your computer and use it in GitHub Desktop.
Envoy secured stats endpoint example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"listeners": [ | |
{ | |
"address": "tcp://0.0.0.0:80", | |
"filters": [ | |
{ | |
"type": "read", | |
"name": "http_connection_manager", | |
"config": { | |
"codec_type": "auto", | |
"stat_prefix": "ingress_http", | |
"route_config": { | |
"virtual_hosts": [ | |
{ | |
"name": "backend", | |
"domains": ["*"], | |
"routes": [ | |
{ | |
"timeout_ms": 0, | |
"prefix": "/stats", | |
"cluster": "service_stats" | |
} | |
] | |
} | |
] | |
}, | |
"filters": [ | |
{ | |
"type": "decoder", | |
"name": "router", | |
"config": {} | |
} | |
] | |
} | |
} | |
] | |
} | |
], | |
"admin": { | |
"access_log_path": "/dev/null", | |
"address": "tcp://127.0.0.1:8001" | |
}, | |
"cluster_manager": { | |
"clusters": [ | |
{ | |
"name": "service_stats", | |
"connect_timeout_ms": 250, | |
"type": "logical_dns", | |
"lb_type": "round_robin", | |
"hosts": [ | |
{ | |
"url": "tcp://127.0.0.1:8001" | |
} | |
] | |
} | |
] | |
} | |
} |
@ofek @michaelDovgal this is an updated config for v3 (I was also trying to implement Datadog monitoring and this works)
admin:
access_log_path: /dev/null
address:
socket_address:
protocol: TCP
address: 127.0.0.1
port_value: 8081
static_resources:
listeners:
- name: stats_listener # exposes the stats endpoint for datadog monitoring
address:
socket_address:
protocol: TCP
address: 0.0.0.0
port_value: 80
filter_chains:
- filters:
- name: envoy.http_connection_manager
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
stat_prefix: ingress_http
route_config:
virtual_hosts:
- name: backend
domains:
- "*"
routes:
- match:
prefix: /stats
route:
cluster: service_stats
http_filters:
- name: envoy.filters.http.router
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
clusters:
- name: service_stats
connect_timeout: 0.250s
type: LOGICAL_DNS
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: service_stats
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: 127.0.0.1
port_value: 8081
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@ofek I assume existing docs on Datadog page are actually for v2 xDS version? So it will be something like this for v3 (haven't tried it though)