Add discovery config spec tooling and krakend reference implementation#24126
Add discovery config spec tooling and krakend reference implementation#24126vitkyrka wants to merge 5 commits into
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
48fb4d7 to
247fee6
Compare
93d8da4 to
15901ae
Compare
15901ae to
a2403a4
Compare
247fee6 to
b447ffe
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b447ffec92
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Adds a discovery section to the spec schema (port_hints, strategy field), extends the example and model consumers to render/generate discovery config, adds spec.py validation for discovery spec correctness, and covers the new paths with tests. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds krakend config_models/discovery.py and auto_conf.yaml for port-based config autodiscovery. Adds get_e2e_discovery_metadata() to ddev docker helpers and a dd_agent_check_discovery pytest fixture so integrations can run discovery-path E2E tests. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… on server To ensure that this no risk with probing the ports of the container for configuration discovery, add a test which instanciates the integration which each of the generated configurations in turn and checks that the container logs don't have any obvious crashes. https://datadoghq.atlassian.net/wiki/spaces/DSCVR/pages/6671862234/Configuration+Discovery+for+Agent+Integrations#Probing-causes-problems While the logic for detecting "bad" effects is best-effort, the test also the logs from this scenario to be seen easier during development. For example, for krakend: ``` $ ddev env test --base --new-env krakend py3.13-2.10 -- -k test_e2e_discovery_candidates_do_not_destabilize_container -rP --log-level=DEBUG ... _________ test_e2e_discovery_candidates_do_not_destabilize_container __________ ------------------------------ Captured log call ------------------------------- DEBUG root:docker.py:90 Probing candidate #1: {'init_config': {}, 'instances': [{'openmetrics_endpoint': 'http://172.17.129.3:9090/metrics'}]} DEBUG root:docker.py:90 Probing candidate #2: {'init_config': {}, 'instances': [{'openmetrics_endpoint': 'http://172.17.129.3:8080/metrics'}]} DEBUG root:docker.py:94 Error probing candidate #2: {'init_config': {}, 'instances': [{'openmetrics_endpoint': 'http://172.17.129.3:8080/metrics'}]} DEBUG root:docker.py:103 New log line: [GIN] 2026/06/17 - 15:31:46 | 404 | 2.803µs | 172.17.129.1 | GET "/metrics" DEBUG root:docker.py:103 New log line: [GIN] 2026/06/17 - 15:31:47 | 404 | 2.753µs | 172.17.129.1 | GET "/metrics" DEBUG root:docker.py:90 Probing candidate #3: {'init_config': {}, 'instances': [{'openmetrics_endpoint': 'http://172.17.129.3:8090/metrics'}]} DEBUG root:docker.py:94 Error probing candidate #3: {'init_config': {}, 'instances': [{'openmetrics_endpoint': 'http://172.17.129.3:8090/metrics'}]} DEBUG root:docker.py:103 New log line: [GIN] 2026/06/17 - 15:31:49 | 200 | 51.868µs | ::1 | GET "/__health" ```
3430189 to
0eb0b05
Compare
Validation ReportAll 21 validations passed. Show details
|

What does this PR do?
datadog_checks_dev— spec toolingdiscovery_validator()tospec.py: validatesad_identifiers,strategies,port_hints, andcandidates; validates template placeholders againstService/Portfieldsauto_conf.yamlwhen adiscoverysection is presentdiscovery.pywith acandidates(service: Service)functionkrakend— reference implementationdiscoverysection tospec.yamlwith onefrom_portsstrategy (port_hints: [9090])auto_conf.yamlanddiscovery.pyviaddevget_e2e_discovery_metadata()helper anddd_agent_check_discoverypytest fixtureThe runtime infrastructure (
AgentCheck.discover_config,Service,Port, probe logic) is in #23963.Motivation
https://datadoghq.atlassian.net/browse/DSCVR-482
https://datadoghq.atlassian.net/wiki/spaces/DSCVR/pages/6671862234/#Integrations-Core
Review checklist (to be filled by reviewers)
qa/requiredif this PR needs QA validation, orqa/skip-qaif it does not. Exactly one of the two is required.backport/<branch-name>label to the PR and it will automatically open a backport PR once this one is merged