diff --git a/n8n/assets/configuration/spec.yaml b/n8n/assets/configuration/spec.yaml index 7768332358582..f828a10ec05c0 100644 --- a/n8n/assets/configuration/spec.yaml +++ b/n8n/assets/configuration/spec.yaml @@ -19,12 +19,11 @@ 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: - display_default: n8n type: string - example: n8n + default: n8n_ raw_metric_prefix.hidden: false - template: logs example: 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 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..e80f23c8c08c1 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 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 = {