Tips

Catalogue
  1. 1. 自定义指标前缀
  2. 2. Envoy 指标对外暴露

自定义指标前缀

istio 没有将所有的配置项都释放出来,因此我们可以通过 EnvoyFilter 这个 CRD 进行操作

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
kind: EnvoyFilter
apiVersion: networking.istio.io/v1alpha3
metadata:
annotations:
name: mysql-stats-settings
namespace: wordpress
spec:
configPatches:
- applyTo: NETWORK_FILTER
match:
context: ANY
listener:
filterChain:
filter:
name: envoy.filters.network.mysql_proxy
patch:
operation: MERGE
value:
typed_config:
"@type": "type.googleapis.com/envoy.extensions.filters.network.mysql_proxy.v3.MySQLProxy"
stat_prefix: egress_mysql

Envoy 指标对外暴露

istio 没有将所有的指标对外暴露,因此需要额外配置: envoy-stats

1
$ kubectl edit configmaps -n istio-system istio
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{
"defaultConfig": {
"discoveryAddress": "istiod.istio-system.svc:15012",
"rootNamespace": "istio-system",
"trustDomain": "cluster.local",
"proxyStatsMatcher": {
"inclusionRegexps": [
".*mysql.*"
],
"inclusionPrefixes": [
"egress_mysql"
]
},
"meshId": "mesh1",
"enablePrometheusMerge": true
},
}