diff --git a/charts/feature-integrations/docs/integrations/cert-manager.md b/charts/feature-integrations/docs/integrations/cert-manager.md index 873fe8cfd..9cae456ba 100644 --- a/charts/feature-integrations/docs/integrations/cert-manager.md +++ b/charts/feature-integrations/docs/integrations/cert-manager.md @@ -11,6 +11,13 @@ | namespaces | list | `[]` | Namespaces to look for cert-manager instances. | | portName | string | `"http-metrics"` | Name of the port to scrape metrics from. | +### Scrape Settings + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| jobName | string | `"integrations/cert-manager"` | The value of the job label for scraped metrics. | +| scrapeInterval | string | `60s` | How frequently to scrape metrics from Windows Exporter. | + ### Metric Processing Settings | Key | Type | Default | Description | @@ -24,9 +31,3 @@ | Key | Type | Default | Description | |-----|------|---------|-------------| | name | string | `""` | Name for this cert-manager instance. | - -### Scrape Settings - -| Key | Type | Default | Description | -|-----|------|---------|-------------| -| scrapeInterval | string | `60s` | How frequently to scrape metrics from Windows Exporter. | diff --git a/charts/feature-integrations/integrations/cert-manager-values.yaml b/charts/feature-integrations/integrations/cert-manager-values.yaml index 1b557b5fc..8618c631a 100644 --- a/charts/feature-integrations/integrations/cert-manager-values.yaml +++ b/charts/feature-integrations/integrations/cert-manager-values.yaml @@ -26,6 +26,10 @@ portName: http-metrics # @section -- Scrape Settings scrapeInterval: +# -- The value of the job label for scraped metrics. +# @section -- Scrape Settings +jobName: integrations/cert-manager + # -- Sets the max_cache_size for cadvisor prometheus.relabel component. # This should be at least 2x-5x your largest scrape target or samples appended rate. # ([docs](https://grafana.com/docs/alloy/latest/reference/components/prometheus.relabel/#arguments)) diff --git a/charts/feature-integrations/schema-mods/definitions/cert-manager-integration.schema.json b/charts/feature-integrations/schema-mods/definitions/cert-manager-integration.schema.json index 0bc8a5ce4..e7fb33663 100644 --- a/charts/feature-integrations/schema-mods/definitions/cert-manager-integration.schema.json +++ b/charts/feature-integrations/schema-mods/definitions/cert-manager-integration.schema.json @@ -4,6 +4,9 @@ "field_selectors": { "type": "array" }, + "jobName": { + "type": "string" + }, "labelSelectors": { "type": "object", "properties": { diff --git a/charts/feature-integrations/templates/_integration_cert-manager.tpl b/charts/feature-integrations/templates/_integration_cert-manager.tpl index 5c14a7bc2..64b5ec105 100644 --- a/charts/feature-integrations/templates/_integration_cert-manager.tpl +++ b/charts/feature-integrations/templates/_integration_cert-manager.tpl @@ -41,13 +41,14 @@ cert_manager.kubernetes {{ include "helper.alloy_name" .name | quote }} { {{- if .namespaces }} namespaces = {{ .namespaces | toJson }} {{- end }} + job_label = {{ .jobName | quote }} {{- if $labelSelectors }} label_selectors = {{ $labelSelectors | toJson }} {{- end }} {{- if $fieldSelectors }} field_selectors = {{ $fieldSelectors | toJson }} {{- end }} - port_name = {{ .portName | quote }} + port_name = {{ .portName | quote }} } cert_manager.scrape {{ include "helper.alloy_name" .name | quote }} { diff --git a/charts/feature-integrations/tests/cert-manager_test.yaml b/charts/feature-integrations/tests/cert-manager_test.yaml index 6ee9cdd86..cf6ded8f6 100644 --- a/charts/feature-integrations/tests/cert-manager_test.yaml +++ b/charts/feature-integrations/tests/cert-manager_test.yaml @@ -28,8 +28,9 @@ tests: } cert_manager.kubernetes "my_cert_manager" { + job_label = "integrations/cert-manager" label_selectors = ["app.kubernetes.io/name=cert-manager"] - port_name = "http-metrics" + port_name = "http-metrics" } cert_manager.scrape "my_cert_manager" { @@ -68,8 +69,9 @@ tests: cert_manager.kubernetes "my_cert_manager" { namespaces = ["kube-system"] + job_label = "integrations/cert-manager" label_selectors = ["app.kubernetes.io/name=cert-manager"] - port_name = "http-metrics" + port_name = "http-metrics" } cert_manager.scrape "my_cert_manager" { diff --git a/charts/feature-integrations/values.schema.json b/charts/feature-integrations/values.schema.json index 96c028b4b..a6bd6b91b 100644 --- a/charts/feature-integrations/values.schema.json +++ b/charts/feature-integrations/values.schema.json @@ -97,6 +97,9 @@ "field_selectors": { "type": "array" }, + "jobName": { + "type": "string" + }, "labelSelectors": { "type": "object", "properties": { diff --git a/charts/k8s-monitoring/charts/k8s-monitoring-feature-integrations-1.0.0.tgz b/charts/k8s-monitoring/charts/k8s-monitoring-feature-integrations-1.0.0.tgz index 1015e20af..6041663fb 100644 Binary files a/charts/k8s-monitoring/charts/k8s-monitoring-feature-integrations-1.0.0.tgz and b/charts/k8s-monitoring/charts/k8s-monitoring-feature-integrations-1.0.0.tgz differ