Commit 2283bb8
n8n: add container-based config discovery (DataDog#23964)
* n8n: add container-based config discovery support
* n8n: pass explicit config to dd_agent_check in regular e2e test
Without an explicit config, dd_agent_check relies on conf.d which now
includes the mounted auto_conf.yaml (from get_e2e_discovery_metadata).
This causes autodiscovery to fire an extra check instance alongside the
two static ones, corrupting metric assertions in test_check_n8n_e2e.
Passing the instances explicitly forces --config-file, which overrides
conf.d and isolates the test from autodiscovery — matching the krakend
reference pattern.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Revert "n8n: pass explicit config to dd_agent_check in regular e2e test"
This reverts commit 7f26c0f.
* n8n: add discovery stub files
* n8n: remove ad_identifiers from discovery spec stanza
* n8n: update discovery.py to new generated format
* n8n: add test_e2e_discovery_all_candidates
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* n8n: fix import sort order in test_e2e.py
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: restore blank line between import groups in test_e2e.py
* Add auto_conf.yaml section to spec.yaml so it is generated from spec.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Regenerate auto_conf.yaml with doc comments from spec template.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Use discovery/openmetrics_from_ports template in n8n spec, consistent with krakend
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Assert both main and worker instances are discovered in test_e2e_discovery.
Both containers share the same image and are both discovered: main on port 5678
(via the hint), worker on port 5680 (via the port fallback). Together they cover
the full metric set so symmetric inclusion can be enabled. Uses
discovery_min_instances=2 as suggested.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Skip test_e2e_discovery in lab mode as auto_conf.yaml is not mounted.
Follows the same approach as krakend.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Extract common assertions into helper to align test_e2e_discovery with test_check_n8n_e2e.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Restore worker readiness comment and explain missing n8n_process tags in discovery test.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 0a4bb24 commit 2283bb8
9 files changed
Lines changed: 135 additions & 11 deletions
File tree
- n8n
- assets/configuration
- changelog.d
- datadog_checks/n8n
- config_models
- data
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
4 | 10 | | |
5 | 11 | | |
6 | 12 | | |
| |||
34 | 40 | | |
35 | 41 | | |
36 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
173 | | - | |
174 | 172 | | |
175 | 173 | | |
176 | 174 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
198 | | - | |
| 198 | + | |
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
13 | 25 | | |
14 | 26 | | |
15 | 27 | | |
| |||
19 | 31 | | |
20 | 32 | | |
21 | 33 | | |
| 34 | + | |
22 | 35 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
0 commit comments