Skip to content

Add metrics_prefix to discovery block - #24861

Open
vitkyrka wants to merge 2 commits into
masterfrom
claude/metrics-prefix-manual-config-9c3ec6
Open

Add metrics_prefix to discovery block#24861
vitkyrka wants to merge 2 commits into
masterfrom
claude/metrics-prefix-manual-config-9c3ec6

Conversation

@vitkyrka

@vitkyrka vitkyrka commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds a metrics_prefix field to the discovery block of auto_conf.yaml for gearmand, krakend, and prefect — the three integrations whose metric prefix diverges from their check name and that currently ship a discovery block.

This allows the core agent to detect conflicts with a generic openmetrics/prometheus config. See https://datadoghq.atlassian.net/wiki/spaces/DSCVR/pages/7031522288/ for more information.

This is an alternative to #24738 which computed the metrics_prefix value automatically at ddev validate config time, by reading each integration's manifest.json or, for integrations without one, the repo's .ddev/config.toml [overrides.metrics-prefix] table (the same source ddev validate metadata already consults). Code owners objected to that approach since it made .ddev/config.toml — a file intended as developer/tooling configuration — production-critical.

This PR instead hand-authors the value directly in each affected integration's spec.yaml, so it's an explicit, reviewable part of the integration's own spec rather than a side effect of unrelated dev tooling. auto_conf.yaml remains a generated file (regenerated here via ddev validate config).

Motivation

https://datadoghq.atlassian.net/browse/DSCVR-640

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

…rakend, prefect

Alternative to PR #24738's auto-detection approach, which computed each
integration's metrics_prefix from manifest.json or the repo's
.ddev/config.toml override table at `ddev validate config` time. Integration
owners raised a concern that this made .ddev/config.toml, a developer/tooling
config file, silently production-critical, since a wrong or missing entry
there would flow straight into the auto_conf.yaml shipped with the Agent.

This hand-authors the same metrics_prefix values directly in each
integration's assets/configuration/spec.yaml via a discovery.example override
on the existing auto_conf/discovery template, using the same override
mechanism already used for ad_identifiers' value.example and krakend's
cel_selector.example. auto_conf.yaml is then regenerated with `ddev validate
config -s`, producing output identical to PR #24738's.

Environment: Datadog workspace

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Environment: Datadog workspace

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Aug 14, 2026

Copy link
Copy Markdown

evalya-impact-summary

evalya impact analysis
Impact analysis: 0 selected, 0 skipped (of 0 test tasks)
Publish tasks:   0 (always emitted)
Diff (9 files):
  gearmand/assets/configuration/spec.yaml
  gearmand/changelog.d/24861.added
  gearmand/datadog_checks/gearmand/data/auto_conf.yaml
  krakend/assets/configuration/spec.yaml
  krakend/changelog.d/24861.added
  krakend/datadog_checks/krakend/data/auto_conf.yaml
  prefect/assets/configuration/spec.yaml
  prefect/changelog.d/24861.added
  prefect/datadog_checks/prefect/data/auto_conf.yaml

Debug a specific task: evalya plan impact --path <path> --task <task>

Learn more about CI impact filtering

@datadog-official

datadog-official Bot commented Aug 14, 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: 87.79% (-0.72%)

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

@vitkyrka vitkyrka changed the title Manually author discovery metrics_prefix in spec.yaml for gearmand, krakend, prefect Add metrics_prefix to discovery block Aug 14, 2026
@vitkyrka
vitkyrka marked this pull request as ready for review August 14, 2026 13:01
@vitkyrka
vitkyrka requested review from a team as code owners August 14, 2026 13:01
@dd-octo-sts

dd-octo-sts Bot commented Aug 14, 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

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.

3 participants