Skip to content

Add discovery port name helper#24555

Merged
vitkyrka merged 4 commits into
masterfrom
vitkyrka/disco-port-name-helper
Jul 16, 2026
Merged

Add discovery port name helper#24555
vitkyrka merged 4 commits into
masterfrom
vitkyrka/disco-port-name-helper

Conversation

@vitkyrka

@vitkyrka vitkyrka commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Add a discovery helper to get ports by name. This will be used in a new strategy which will allow ports to be selected using the name specified in the Kubernetes deployment. This strategy can be re-used by multiple integrations whose services use named ports for their metrics port, such as velero or argo_rollouts.

This helper is unused in this PR except for tests but is added in a separate PR following the example of earlier PRs where it was requested to keep changes to datadog_checks_base separate from other changes.

Motivation

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Add qa/required if this PR needs QA validation, or qa/skip-qa if it does not. Exactly one of the two is required.
  • If you need to backport this PR to another branch, you can add the backport/<branch-name> label to the PR and it will automatically open a backport PR once this one is merged

vitkyrka commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@datadog-prod-us1-4

datadog-prod-us1-4 Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Tests  Code Coverage

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 88.38% (+0.11%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 26b0664 | Docs | Datadog PR Page | Give us feedback!

@vitkyrka
vitkyrka force-pushed the vitkyrka/disco-port-name-helper branch from 09a231c to 57e665d Compare July 15, 2026 09:42
@vitkyrka vitkyrka added the qa/skip-qa Automatically skip this PR for the next QA label Jul 15, 2026 — with Graphite App
vitkyrka and others added 3 commits July 15, 2026 10:08
An empty string in `names` would otherwise match every unnamed port
(Port.name defaults to ""), which is the opposite of the intended
match-by-name semantics.

Environment: Datadog workspace

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The one-liner omitted the name-priority ordering and no-fallback
behavior that the existing tests already assert, matching the sibling
candidate_ports docstring's existing standard.

Environment: Datadog workspace

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Folds the five standalone tests into one pytest.mark.parametrize table,
keeping the scenario names as ids so they stay visually aligned and
distinguishable.

Environment: Datadog workspace

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@dd-octo-sts

dd-octo-sts Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Validation Report

All 21 validations passed.

Show details
Validation Description Status
agent-reqs Verify check versions match the Agent requirements file
ci Validate CI configuration and code coverage settings
codeowners Validate every integration has a CODEOWNERS entry
config Validate default configuration files against spec.yaml
dep Verify dependency pins are consistent and Agent-compatible
http Validate integrations use the HTTP wrapper correctly
imports Validate check imports do not use deprecated modules
integration-style Validate check code style conventions
jmx-metrics Validate JMX metrics definition files and config
labeler Validate PR labeler config matches integration directories
legacy-signature Validate no integration uses the legacy Agent check signature
license-headers Validate Python files have proper license headers
licenses Validate third-party license attribution list
metadata Validate metadata.csv metric definitions
models Validate configuration data models match spec.yaml
openmetrics Validate OpenMetrics integrations disable the metric limit
package Validate Python package metadata and naming
qa-label Validate the pull request declares whether it needs QA for the next Agent release
readmes Validate README files have required sections
saved-views Validate saved view JSON file structure and fields
version Validate version consistency between package and changelog

View full run

@vitkyrka
vitkyrka added this pull request to the merge queue Jul 16, 2026
Merged via the queue into master with commit 50cc010 Jul 16, 2026
368 of 372 checks passed
@vitkyrka
vitkyrka deleted the vitkyrka/disco-port-name-helper branch July 16, 2026 07:32
@dd-octo-sts dd-octo-sts Bot added this to the 7.83.0 milestone Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants