Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions n8n/assets/configuration/spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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_
Comment thread
sarah-witt marked this conversation as resolved.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: Thanks a lot for this!!

raw_metric_prefix.hidden: false
- template: logs
example:
Expand Down
1 change: 1 addition & 0 deletions n8n/changelog.d/23598.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix default raw metric prefix.
5 changes: 4 additions & 1 deletion n8n/datadog_checks/n8n/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion n8n/datadog_checks/n8n/config_models/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def instance_persist_connections():


def instance_raw_metric_prefix():
return 'n8n'
return 'n8n_'


def instance_request_size():
Expand Down
6 changes: 3 additions & 3 deletions n8n/datadog_checks/n8n/data/conf.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -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: <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
Expand Down
1 change: 0 additions & 1 deletion n8n/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
Loading