Skip to content

Rename get_default_config to get_default_metrics in redis_cloud/redis_enterprise checks - #3128

Closed
philjlee wants to merge 1 commit into
philip.lee/fix-validate-config-models-driftfrom
philip.lee/fix-redis-openmetrics-default-config-collision
Closed

Rename get_default_config to get_default_metrics in redis_cloud/redis_enterprise checks#3128
philjlee wants to merge 1 commit into
philip.lee/fix-validate-config-models-driftfrom
philip.lee/fix-redis-openmetrics-default-config-collision

Conversation

@philjlee

Copy link
Copy Markdown
Collaborator

What

Renames the get_default_config() method on RedisCloudCheck and
RedisEnterpriseCheck to get_default_metrics().

Why

Both checks defined their own get_default_config() returning a list of
metric groups. A newer datadog-checks-base adds its own
get_default_config() hook to OpenMetricsBaseCheckV2, used internally by
get_config_with_defaults() to seed scraper config from the check's
generated config_models defaults (expects key/value pairs). Because
pyproject.toml pins datadog-checks-base>=37.20.0 with no upper bound,
CI resolves the latest version, whose base class method gets shadowed by
each check's same-named override — get_config_with_defaults() then calls
the check's list-returning method instead and dict() raises:

ValueError: dictionary update sequence element #0 has length 65; 2 is required

Confirmed pre-existing and unrelated to any other open PR: reproduced on an
unmodified checkout of master via uvx --python 3.13 ddev@18.0.0 -x test redis_cloud — the failure is byte-for-byte identical. It's only visible in
CI when a PR happens to touch files inside redis_cloud/ or
redis_enterprise/, since TARGET=changed scopes the test matrix to
touched directories.

How

Renamed the check-specific method (and its one call site in
_parse_config) in both integrations from get_default_config to
get_default_metrics, which no longer collides with the base class's
config-defaults hook.

Verified locally with ddev@18.0.0 (the version CI's test workflow
resolves): redis_cloud 5/5 passing, redis_enterprise 7/7 passing, lint
clean.

…_enterprise checks

Both RedisCloudCheck and RedisEnterpriseCheck defined a get_default_config()
method returning a list of metric groups. A newer datadog-checks-base adds
its own get_default_config() to OpenMetricsBaseCheckV2, used internally by
get_config_with_defaults() to seed scraper config from the generated
config_models defaults (expects key/value pairs, not a metrics list). The
override shadows the base method, so get_config_with_defaults() calls the
check's version instead and dict() blows up trying to consume a list of
metric dicts as key/value pairs.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@philjlee
philjlee changed the base branch from master to philip.lee/fix-validate-config-models-drift August 24, 2026 20:57
@datadog-official

This comment has been minimized.

@philjlee

Copy link
Copy Markdown
Collaborator Author

Superseded — combined into #3127. Both PRs touched the same redis_cloud/redis_enterprise directories, and under CI's TARGET=changed scoping neither could pass independently of the other (whichever was checked standalone would fail on the other's pre-existing bug). Folded the get_default_config rename into #3127 alongside the drift fix.

@philjlee philjlee closed this Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant