From 9dfe36476a81717cb0ab5dfe58a59c88920129a9 Mon Sep 17 00:00:00 2001 From: sarah-witt Date: Tue, 5 May 2026 10:29:04 -0400 Subject: [PATCH 1/4] Add n8n default --- n8n/assets/configuration/spec.yaml | 3 +-- n8n/datadog_checks/n8n/check.py | 5 ++++- n8n/datadog_checks/n8n/config_models/defaults.py | 2 +- n8n/datadog_checks/n8n/data/conf.yaml.example | 4 ++-- n8n/tests/common.py | 1 - 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/n8n/assets/configuration/spec.yaml b/n8n/assets/configuration/spec.yaml index 7768332358582..0fd8c09129a7a 100644 --- a/n8n/assets/configuration/spec.yaml +++ b/n8n/assets/configuration/spec.yaml @@ -22,9 +22,8 @@ files: If not set, the default prefix n8n is used. If you are using a custom prefix in n8n through N8N_METRICS_PREFIX, you need to set it here. raw_metric_prefix.value: - display_default: n8n type: string - example: n8n + default: n8n_ raw_metric_prefix.hidden: false - template: logs example: diff --git a/n8n/datadog_checks/n8n/check.py b/n8n/datadog_checks/n8n/check.py index 74ae4c5f766af..00c41569b83d5 100644 --- a/n8n/datadog_checks/n8n/check.py +++ b/n8n/datadog_checks/n8n/check.py @@ -7,10 +7,12 @@ from datadog_checks.base import OpenMetricsBaseCheckV2 from datadog_checks.n8n.metrics import METRIC_MAP, RENAME_LABELS_MAP +from .config_models import ConfigMixin + DEFAULT_READY_ENDPOINT = '/healthz/readiness' -class N8nCheck(OpenMetricsBaseCheckV2): +class N8nCheck(OpenMetricsBaseCheckV2, ConfigMixin): __NAMESPACE__ = 'n8n' DEFAULT_METRIC_LIMIT = 0 @@ -28,6 +30,7 @@ def get_default_config(self): return { 'metrics': [METRIC_MAP], 'rename_labels': RENAME_LABELS_MAP, + 'raw_metric_prefix': 'n8n_', } def _check_n8n_readiness(self): diff --git a/n8n/datadog_checks/n8n/config_models/defaults.py b/n8n/datadog_checks/n8n/config_models/defaults.py index 2b74130ef9dd6..d58197e8a37b8 100644 --- a/n8n/datadog_checks/n8n/config_models/defaults.py +++ b/n8n/datadog_checks/n8n/config_models/defaults.py @@ -85,7 +85,7 @@ def instance_persist_connections(): def instance_raw_metric_prefix(): - return 'n8n' + return 'n8n_' def instance_request_size(): diff --git a/n8n/datadog_checks/n8n/data/conf.yaml.example b/n8n/datadog_checks/n8n/data/conf.yaml.example index 66e670d8f8d88..300cb8b4c3f8b 100644 --- a/n8n/datadog_checks/n8n/data/conf.yaml.example +++ b/n8n/datadog_checks/n8n/data/conf.yaml.example @@ -20,12 +20,12 @@ instances: # - openmetrics_endpoint: http://localhost:5678 - ## @param raw_metric_prefix - string - optional - default: n8n + ## @param raw_metric_prefix - string - optional - default: n8n_ ## The prefix prepended to all metrics from n8n. ## If not set, the default prefix n8n is used. ## If you are using a custom prefix in n8n through N8N_METRICS_PREFIX, you need to set it here. # - # raw_metric_prefix: n8n + # raw_metric_prefix: ## @param extra_metrics - (list of string or mapping) - optional ## This list defines metrics to collect from the `openmetrics_endpoint`, in addition to diff --git a/n8n/tests/common.py b/n8n/tests/common.py index d820b7d8a9ec7..34e3fb84ead38 100644 --- a/n8n/tests/common.py +++ b/n8n/tests/common.py @@ -18,7 +18,6 @@ def get_fixture_path(filename): OPENMETRICS_URL = f'http://{HOST}:{PORT}' INSTANCE = { 'openmetrics_endpoint': f'{OPENMETRICS_URL}/metrics', - 'raw_metric_prefix': 'n8n_', } E2E_METADATA = { From 53053698cc757bb5210033b8c2b4d51e75dc26d9 Mon Sep 17 00:00:00 2001 From: sarah-witt Date: Tue, 5 May 2026 10:44:31 -0400 Subject: [PATCH 2/4] Add changelog --- n8n/changelog.d/23598.fixed | 1 + 1 file changed, 1 insertion(+) create mode 100644 n8n/changelog.d/23598.fixed diff --git a/n8n/changelog.d/23598.fixed b/n8n/changelog.d/23598.fixed new file mode 100644 index 0000000000000..faae6baef0c62 --- /dev/null +++ b/n8n/changelog.d/23598.fixed @@ -0,0 +1 @@ +Fix default raw metric prefix. \ No newline at end of file From e5fcdf55337078c0869b2e44a2da4515f9712f32 Mon Sep 17 00:00:00 2001 From: Sarah Witt Date: Tue, 5 May 2026 11:57:47 -0400 Subject: [PATCH 3/4] Apply suggestion from @sarah-witt --- n8n/assets/configuration/spec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/n8n/assets/configuration/spec.yaml b/n8n/assets/configuration/spec.yaml index 0fd8c09129a7a..f828a10ec05c0 100644 --- a/n8n/assets/configuration/spec.yaml +++ b/n8n/assets/configuration/spec.yaml @@ -19,7 +19,7 @@ files: https://docs.n8n.io/hosting/configuration/environment-variables/endpoints/ raw_metric_prefix.description: | The prefix prepended to all metrics from n8n. - If not set, the default prefix n8n is used. + If not set, the default prefix n8n_ is used. If you are using a custom prefix in n8n through N8N_METRICS_PREFIX, you need to set it here. raw_metric_prefix.value: type: string From fe3d7f25629cb3875203a966048dfc8f4d7139fd Mon Sep 17 00:00:00 2001 From: sarah-witt Date: Tue, 5 May 2026 12:13:58 -0400 Subject: [PATCH 4/4] validate --- n8n/datadog_checks/n8n/data/conf.yaml.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/n8n/datadog_checks/n8n/data/conf.yaml.example b/n8n/datadog_checks/n8n/data/conf.yaml.example index 300cb8b4c3f8b..e80f23c8c08c1 100644 --- a/n8n/datadog_checks/n8n/data/conf.yaml.example +++ b/n8n/datadog_checks/n8n/data/conf.yaml.example @@ -22,7 +22,7 @@ instances: ## @param raw_metric_prefix - string - optional - default: n8n_ ## The prefix prepended to all metrics from n8n. - ## If not set, the default prefix n8n is used. + ## If not set, the default prefix n8n_ is used. ## If you are using a custom prefix in n8n through N8N_METRICS_PREFIX, you need to set it here. # # raw_metric_prefix: