From 9e900066e8853588e3b0f5bcdb3b23a4b9241267 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9na=C3=AFc=20Huard?= Date: Tue, 22 Jun 2021 10:57:00 +0200 Subject: [PATCH 1/3] [kube_scheduler] Update `auto_conf.yaml` to provide a list of possible Prometheus URLs --- .../kube_scheduler/data/auto_conf.yaml | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/kube_scheduler/datadog_checks/kube_scheduler/data/auto_conf.yaml b/kube_scheduler/datadog_checks/kube_scheduler/data/auto_conf.yaml index 869c8e64d1696..607b5306820b9 100644 --- a/kube_scheduler/datadog_checks/kube_scheduler/data/auto_conf.yaml +++ b/kube_scheduler/datadog_checks/kube_scheduler/data/auto_conf.yaml @@ -14,23 +14,35 @@ init_config: # instances: - ## @param prometheus_url - string - required + ## @param prometheus_possible_urls - list(string) - optional + ## The URLs to try to get your application metrics that are exposed by Prometheus. + ## The check will try each URLs in the list and will use the first working one. + ## One of prometheus_possible_urls or prometheus_url parameter is required. + # + - prometheus_possible_urls: + - https://%%host%%:10259/metrics + - https://localhost:10259/metrics + - http://%%host%%:10251/metrics + - http://localhost:10251/metrics + + ## @param prometheus_url - string - optional ## The URL where your application metrics are exposed by Prometheus. + ## One of prometheus_possible_urls or prometheus_url parameter is required. # - - prometheus_url: http://%%host%%:10251/metrics + # prometheus_url: http://%%host%%:10251/metrics - ## @param bearer_token_auth - boolean - optional - default: true + ## @param bearer_token_auth - boolean - optional - default: false ## Used if you are using RBACs and need the Agent to authenticate ## against the APIServer to retrieve metrics. Default to true. # - # bearer_token_auth: true + bearer_token_auth: true ## @param bearer_token_path - string - optional - default: /var/run/secrets/kubernetes.io/serviceaccount/token ## Used to specify the path where the service account token is located. # # bearer_token_path: /var/run/secrets/kubernetes.io/serviceaccount/token - ## @param ssl_verify - boolean - optional - default: false + ## @param ssl_verify - boolean - optional - default: true ## Used to verify self signed certificates. # - # ssl_verify: false + ssl_verify: false From f50900a03f53b669a546b659a53f9bdcbfa01ebb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9na=C3=AFc=20Huard?= Date: Tue, 22 Jun 2021 14:14:50 +0200 Subject: [PATCH 2/3] Update `assets/configuration/spec.yaml` to re-generate `auto_conf.yaml` --- kube_scheduler/assets/configuration/spec.yaml | 23 +++++++++++++++++-- .../kube_scheduler/data/auto_conf.yaml | 8 +++---- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/kube_scheduler/assets/configuration/spec.yaml b/kube_scheduler/assets/configuration/spec.yaml index 02635bf4bcad7..2111966479482 100644 --- a/kube_scheduler/assets/configuration/spec.yaml +++ b/kube_scheduler/assets/configuration/spec.yaml @@ -40,13 +40,31 @@ files: options: [] - template: instances options: - - name: prometheus_url + - name: prometheus_possible_urls required: true - description: The URL where your application metrics are exposed by Prometheus. + description: | + The URLs to try to get your application metrics that are exposed by Prometheus. + The check will try each URLs in the list and will use the first working one. + One of prometheus_possible_urls or prometheus_url parameter is required. + value: + type: array + items: + type: string + example: + - https://%%host%%:10259/metrics + - https://localhost:10259/metrics + - http://%%host%%:10251/metrics + - http://localhost:10251/metrics + - name: prometheus_url + required: false + description: | + The URL where your application metrics are exposed by Prometheus. + One of prometheus_possible_urls or prometheus_url parameter is required. value: example: http://%%host%%:10251/metrics type: string - name: bearer_token_auth + required: true description: | Used if you are using RBACs and need the Agent to authenticate against the APIServer to retrieve metrics. Default to true. @@ -59,6 +77,7 @@ files: type: string example: /var/run/secrets/kubernetes.io/serviceaccount/token - name: ssl_verify + required: true description: Used to verify self signed certificates. value: type: boolean diff --git a/kube_scheduler/datadog_checks/kube_scheduler/data/auto_conf.yaml b/kube_scheduler/datadog_checks/kube_scheduler/data/auto_conf.yaml index 607b5306820b9..601913834ac29 100644 --- a/kube_scheduler/datadog_checks/kube_scheduler/data/auto_conf.yaml +++ b/kube_scheduler/datadog_checks/kube_scheduler/data/auto_conf.yaml @@ -14,7 +14,7 @@ init_config: # instances: - ## @param prometheus_possible_urls - list(string) - optional + ## @param prometheus_possible_urls - list of strings - required ## The URLs to try to get your application metrics that are exposed by Prometheus. ## The check will try each URLs in the list and will use the first working one. ## One of prometheus_possible_urls or prometheus_url parameter is required. @@ -25,13 +25,13 @@ instances: - http://%%host%%:10251/metrics - http://localhost:10251/metrics - ## @param prometheus_url - string - optional + ## @param prometheus_url - string - optional - default: http://%%host%%:10251/metrics ## The URL where your application metrics are exposed by Prometheus. ## One of prometheus_possible_urls or prometheus_url parameter is required. # # prometheus_url: http://%%host%%:10251/metrics - ## @param bearer_token_auth - boolean - optional - default: false + ## @param bearer_token_auth - boolean - required ## Used if you are using RBACs and need the Agent to authenticate ## against the APIServer to retrieve metrics. Default to true. # @@ -42,7 +42,7 @@ instances: # # bearer_token_path: /var/run/secrets/kubernetes.io/serviceaccount/token - ## @param ssl_verify - boolean - optional - default: true + ## @param ssl_verify - boolean - required ## Used to verify self signed certificates. # ssl_verify: false From 7c4d6eada19375ce863435b116dc03ec72815265 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9na=C3=AFc=20Huard?= Date: Wed, 30 Jun 2021 18:15:32 +0200 Subject: [PATCH 3/3] Rename `prometheus_possible_urls` into `possible_prometheus_urls` --- kube_scheduler/assets/configuration/spec.yaml | 6 +++--- .../datadog_checks/kube_scheduler/data/auto_conf.yaml | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/kube_scheduler/assets/configuration/spec.yaml b/kube_scheduler/assets/configuration/spec.yaml index 2111966479482..18cb9a0a871eb 100644 --- a/kube_scheduler/assets/configuration/spec.yaml +++ b/kube_scheduler/assets/configuration/spec.yaml @@ -40,12 +40,12 @@ files: options: [] - template: instances options: - - name: prometheus_possible_urls + - name: possible_prometheus_urls required: true description: | The URLs to try to get your application metrics that are exposed by Prometheus. The check will try each URLs in the list and will use the first working one. - One of prometheus_possible_urls or prometheus_url parameter is required. + One of possible_prometheus_urls or prometheus_url parameter is required. value: type: array items: @@ -59,7 +59,7 @@ files: required: false description: | The URL where your application metrics are exposed by Prometheus. - One of prometheus_possible_urls or prometheus_url parameter is required. + One of possible_prometheus_urls or prometheus_url parameter is required. value: example: http://%%host%%:10251/metrics type: string diff --git a/kube_scheduler/datadog_checks/kube_scheduler/data/auto_conf.yaml b/kube_scheduler/datadog_checks/kube_scheduler/data/auto_conf.yaml index 601913834ac29..28febbfddf7b0 100644 --- a/kube_scheduler/datadog_checks/kube_scheduler/data/auto_conf.yaml +++ b/kube_scheduler/datadog_checks/kube_scheduler/data/auto_conf.yaml @@ -14,12 +14,12 @@ init_config: # instances: - ## @param prometheus_possible_urls - list of strings - required + ## @param possible_prometheus_urls - list of strings - required ## The URLs to try to get your application metrics that are exposed by Prometheus. ## The check will try each URLs in the list and will use the first working one. - ## One of prometheus_possible_urls or prometheus_url parameter is required. + ## One of possible_prometheus_urls or prometheus_url parameter is required. # - - prometheus_possible_urls: + - possible_prometheus_urls: - https://%%host%%:10259/metrics - https://localhost:10259/metrics - http://%%host%%:10251/metrics @@ -27,7 +27,7 @@ instances: ## @param prometheus_url - string - optional - default: http://%%host%%:10251/metrics ## The URL where your application metrics are exposed by Prometheus. - ## One of prometheus_possible_urls or prometheus_url parameter is required. + ## One of possible_prometheus_urls or prometheus_url parameter is required. # # prometheus_url: http://%%host%%:10251/metrics