envoyproxy / envoyproxy/gateway

Enriching the Prometheus metric labels emitted by Envoy from xRoute labels

Open
#2,488 12 comments 1 reaction 0 assignees View on GitHub
stale triage
Dominant language
Go
Stars
3k
Forks
864
Avg merge
2d 2h
Merged PRs (30d)
140

Description

*Description*:
Although metrics emitted by the envoy instance look good, it shows a very limited label in it, for example:
```
envoy_cluster_upstream_rq_time_bucket{envoy_cluster_name="httproute///rule/0",le="0.5"} 11
```

Subsequently, wonder about the feasibility of adding more valuable information, such as the labels from `xRoute` resources directly into the metric.

An example of this could be the application of the following `HTTPRoute` manifest:

```
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: example
namespace: envoy-gateway-system
labels:
host: www.example.com
tribe: virtual-product
squad: game-voucher
spec:
hostnames:
- www.example.com
parentRefs:
- group: gateway.networking.k8s.io
kind: Gateway
name: default-gateway
namespace: envoy-gateway-system
rules:
- backendRefs:
- group: ""
kind: Service
name: echoserver
namespace: default
port: 80
matches:
- path:
type: PathPrefix
value: /
```

As a result, the Envoy-emitted metric would appear as shown below:
```
envoy_cluster_upstream_rq_time_bucket{envoy_cluster_name="httproute/envoy-gateway-system/example/rule/0",host="www.example.com",tribe="virtual-product",squad="game-voucher",le="0.5"} 11
```

[optional *Relevant Links*:]
>Any extra documentation required to understand the issue.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.