From 4dde065efdda72c85d7e1437bb53d453ce09c118 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9na=C3=AFc=20Huard?= Date: Fri, 9 Dec 2022 09:09:49 +0100 Subject: [PATCH] Document the new `annotations_as_tags` parameter of the KSM core check (#13320) --- .../assets/configuration/spec.yaml | 17 ++++++++++++++--- .../data/conf.yaml.example | 15 ++++++++++++--- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/kubernetes_state_core/assets/configuration/spec.yaml b/kubernetes_state_core/assets/configuration/spec.yaml index e6b93ecb2e1e9..1b87f29e0166b 100644 --- a/kubernetes_state_core/assets/configuration/spec.yaml +++ b/kubernetes_state_core/assets/configuration/spec.yaml @@ -39,15 +39,26 @@ files: - label_addonmanager_kubernetes_io_mode - name: labels_as_tags required: false + description: | + labels_as_tags allows to specify custom labels of kubernetes resources to be turned into Datadog tags attached the corresponding metrics. value: type: object example: labels_as_tags: pod: - - "app_*" + app.kubernetes.io/name: kube_app_name node: - - "zone" - - "team_*" + topology.kubernetes.io/region: kube_region + - name: annotations_as_tags + required: false + description: | + annotations_as_tags allows to specify custom annotations of kubernetes resources to be turned into Datadog tags attached the corresponding metrics. + value: + type: object + example: + annotations_as_tags: + pod: + my_pod_annotation: my_pod_tag - name: labels_mapper required: false description: | diff --git a/kubernetes_state_core/datadog_checks/kubernetes_state_core/data/conf.yaml.example b/kubernetes_state_core/datadog_checks/kubernetes_state_core/data/conf.yaml.example index 0c8ee12a85cad..e4bdd51d69d4c 100644 --- a/kubernetes_state_core/datadog_checks/kubernetes_state_core/data/conf.yaml.example +++ b/kubernetes_state_core/datadog_checks/kubernetes_state_core/data/conf.yaml.example @@ -39,15 +39,24 @@ instances: # - label_addonmanager_kubernetes_io_mode ## @param labels_as_tags - map - optional + ## labels_as_tags allows to specify custom labels of kubernetes resources to be turned into Datadog tags attached the corresponding metrics. ## ## Example: # # labels_as_tags: # pod: - # - "app_*" + # app.kubernetes.io/name: kube_app_name # node: - # - "zone" - # - "team_*" + # topology.kubernetes.io/region: kube_region + + ## @param annotations_as_tags - map - optional + ## annotations_as_tags allows to specify custom annotations of kubernetes resources to be turned into Datadog tags attached the corresponding metrics. + ## + ## Example: + # + # annotations_as_tags: + # pod: + # my_pod_annotation: my_pod_tag ## @param labels_mapper - map - optional ## LabelsMapper can be used to translate kube-state-metrics labels to other tags.