cw-infra-apps/grafana/charts/feature-auto-instrumentation/tests/default_test.yaml

62 lines
2.1 KiB
YAML

# yamllint disable rule:document-start rule:line-length rule:trailing-spaces
suite: Test default values
templates:
- configmap.yaml
tests:
- it: creates a module with default Beyla configuration
set:
deployAsConfigMap: true
asserts:
- isKind:
of: ConfigMap
- equal:
path: data["module.alloy"]
value: |-
declare "auto_instrumentation" {
argument "metrics_destinations" {
comment = "Must be a list of metric destinations where collected metrics should be forwarded to"
}
discovery.kubernetes "beyla_pods" {
role = "pod"
namespaces {
own_namespace = true
}
selectors {
role = "pod"
label = "app.kubernetes.io/name=beyla"
}
}
discovery.relabel "beyla_pods" {
targets = discovery.kubernetes.beyla_pods.targets
rule {
source_labels = ["__meta_kubernetes_pod_node_name"]
action = "replace"
target_label = "instance"
}
}
prometheus.scrape "beyla_applications" {
targets = discovery.relabel.beyla_pods.output
honor_labels = true
scrape_interval = "60s"
clustering {
enabled = true
}
forward_to = argument.metrics_destinations.value
}
prometheus.scrape "beyla_internal" {
targets = discovery.relabel.beyla_pods.output
metrics_path = "/internal/metrics"
job_name = "integrations/beyla"
honor_labels = true
scrape_interval = "60s"
clustering {
enabled = true
}
forward_to = argument.metrics_destinations.value
}
}