Skip to content

gearmand: add container-based config discovery support#24487

Draft
vitkyrka wants to merge 1 commit into
vwhitchurch/docker-run-env-vars-e2efrom
vwhitchurch/gearmand-discovery
Draft

gearmand: add container-based config discovery support#24487
vitkyrka wants to merge 1 commit into
vwhitchurch/docker-run-env-vars-e2efrom
vwhitchurch/gearmand-discovery

Conversation

@vitkyrka

@vitkyrka vitkyrka commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds container-based config discovery support to gearmand.

  • Port selection rationale: Port 4730 is gearmand's well-known default job-server port, documented in the Gearman protocol spec. This check pulls stats from the same port.

  • Endpoint: gearmand's admin protocol is raw TCP (not HTTP), and the check's config uses separate server/port fields rather than a URL field, so spec.yaml uses the manual from_ports strategy form (candidates: - server: ..., port: ...) instead of the discovery/openmetrics_from_ports template.

  • Standard image: there's no single "official" Docker Hub image for gearmand, but several actively used, vendor-published community images all share the same short name gearmand (e.g. artefactual/gearmand, used by the Archivematica project and also used by this integration's own test fixture; dockage/gearmand; appscode/gearmand).

  • Exact-tag-match test helper: the existing test_e2e's assertions (assert_metrics() in tests/test_integration_e2e.py) use assert_metric/assert_service_check with a fixed tags= list, which does exact tag-set matching. Discovery can't reproduce that same tag set — the server tag reflects the discovered container's own docker-network address rather than common.HOST, no tags config field is set (discovery has no way to derive it), and Autodiscovery injects its own container tags (docker_image, image_id, ...) on top, so we drop the tag assertion.

  • Compose service name mismatch: the compose file's service is named gearman (see tests/compose/docker-compose.yaml), not gearmand, so test_e2e_discovery_all_candidates passes compose_service='gearman' explicitly — the helper's default fallback resolves to the integration's own package name (gearmand), which wouldn't match.

Motivation

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

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

@datadog-official

datadog-official Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Tests  Code Coverage

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 66.67%
Overall Coverage: 76.33% (-12.04%)

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

@vitkyrka vitkyrka changed the base branch from master to graphite-base/24487 July 14, 2026 12:48
@vitkyrka vitkyrka force-pushed the vwhitchurch/gearmand-discovery branch from 0864654 to b8e919a Compare July 14, 2026 12:48
@vitkyrka vitkyrka changed the base branch from graphite-base/24487 to vwhitchurch/docker-run-env-vars-e2e July 14, 2026 12:48

Copy link
Copy Markdown
Contributor Author

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.
Learn more

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

Adds a from_ports discovery strategy targeting gearmand's raw TCP admin
protocol port (4730), and wires the E2E fixture and tests for it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@vitkyrka vitkyrka force-pushed the vwhitchurch/docker-run-env-vars-e2e branch from 3251f62 to f4762a7 Compare July 14, 2026 14:28
@vitkyrka vitkyrka force-pushed the vwhitchurch/gearmand-discovery branch from 541cd70 to 2c17612 Compare July 14, 2026 14:28
@dd-octo-sts

dd-octo-sts Bot commented Jul 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.

1 participant