Trim the published metrics
Start from the Basic profile, drop a family of Envoy cluster metrics, and add back the request counters. Include takes precedence over exclude.
Configuration
apiVersion: kuma.io/v1alpha1
kind: MeshMetric
metadata:
name: backend-metric-profile
namespace: kong-mesh-demo
labels:
kuma.io/mesh: default
spec:
targetRef:
kind: Dataplane
labels:
app: backend
default:
sidecar:
profiles:
appendProfiles:
- name: Basic
exclude:
- type: Prefix
match: envoy_cluster_
include:
- type: Contains
match: upstream_rq
backends:
- type: Prometheus
prometheus:
port: 5670Copied!
type: MeshMetric
name: backend-metric-profile
mesh: default
spec:
targetRef:
kind: Dataplane
labels:
app: backend
default:
sidecar:
profiles:
appendProfiles:
- name: Basic
exclude:
- type: Prefix
match: envoy_cluster_
include:
- type: Contains
match: upstream_rq
backends:
- type: Prometheus
prometheus:
port: 5670Copied!
Adjust konnect_mesh_control_plane.my_meshcontrolplane.id and konnect_mesh.my_mesh.name according to your current configuration.
resource "konnect_mesh_metric" "backend_metric_profile" {
provider = konnect-beta
type = "MeshMetric"
name = "backend-metric-profile"
spec = {
target_ref = {
kind = "Dataplane"
labels = {
app = "backend"
}
}
default = {
sidecar = {
profiles = {
append_profiles = [
{
name = "Basic"
}
]
exclude = [
{
type = "Prefix"
match = "envoy_cluster_"
}
]
include = [
{
type = "Contains"
match = "upstream_rq"
}
]
}
}
backends = [
{
type = "Prometheus"
prometheus = {
port = 5670
}
}
]
}
}
labels = {
"kuma.io/mesh" = konnect_mesh.my_mesh.name
}
cp_id = konnect_mesh_control_plane.my_meshcontrolplane.id
mesh = konnect_mesh.my_mesh.name
}
Copied!