zero/telemetry: internal envoy stats scraper and metrics producer (#5136)

This commit is contained in:
Denis Mishin 2024-06-16 20:41:05 -04:00 committed by GitHub
parent c3534df885
commit c1dec06afa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 667 additions and 301 deletions

View file

@ -132,5 +132,19 @@ func (b *Builder) buildOutboundRoutes() []*envoy_config_route_v3.Route {
})
}
}
routes = append(routes, &envoy_config_route_v3.Route{
Name: "envoy-metrics",
Match: &envoy_config_route_v3.RouteMatch{
PathSpecifier: &envoy_config_route_v3.RouteMatch_Prefix{Prefix: "/envoy/stats/prometheus"},
},
Action: &envoy_config_route_v3.Route_Route{
Route: &envoy_config_route_v3.RouteAction{
ClusterSpecifier: &envoy_config_route_v3.RouteAction_Cluster{
Cluster: envoyAdminClusterName,
},
PrefixRewrite: "/stats/prometheus",
},
},
})
return routes
}

View file

@ -61,6 +61,16 @@ func Test_buildOutboundRoutes(t *testing.T) {
"idleTimeout": "0s",
"timeout": "0s"
}
},
{
"match": {
"prefix": "/envoy/stats/prometheus"
},
"name": "envoy-metrics",
"route": {
"cluster": "pomerium-envoy-admin",
"prefixRewrite": "/stats/prometheus"
}
}
]`, routes)
}