Skip to content

gitlab: add container-based config discovery support#24324

Draft
vitkyrka wants to merge 2 commits into
vwhitchurch/docker-run-env-vars-e2efrom
vwhitchurch/gitlab-discovery
Draft

gitlab: add container-based config discovery support#24324
vitkyrka wants to merge 2 commits into
vwhitchurch/docker-run-env-vars-e2efrom
vwhitchurch/gitlab-discovery

Conversation

@vitkyrka

@vitkyrka vitkyrka commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds container-based config discovery support to the gitlab integration.

We only support the OpenMetrics-based check, not the legacy check.

discovery only populates openmetrics_endpoint, not gitlab_url (which requires the GitLab base URL and can't be inferred from container introspection alone). GitlabCheckV2 already guards all gitlab_url-dependent behavior (readiness/liveness checks, version metadata, several tags) behind if self.config.gitlab_url: and logs a debug message otherwise, so the OpenMetrics scrape itself works correctly without it. test_e2e_discovery only asserts gitlab.openmetrics.health and metrics for this reason.

Motivation

DSCVR-535

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-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Jul 6, 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: 92.28% (+3.85%)

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

@vitkyrka
vitkyrka changed the base branch from master to graphite-base/24324 July 17, 2026 09:55
@vitkyrka
vitkyrka force-pushed the vwhitchurch/gitlab-discovery branch from e791c15 to f61dc8b Compare July 17, 2026 09:55
@vitkyrka
vitkyrka changed the base branch from graphite-base/24324 to vwhitchurch/docker-run-env-vars-e2e July 17, 2026 09:55

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.

Lets the Agent auto-discover a gitlab-ce container's OpenMetrics endpoint
(port 80, /-/metrics) via the gitlab-ce AD identifier, following the same
pattern established for other OpenMetrics integrations (e.g. krakend, teleport).

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a3df0c7e6f

ℹ️ 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".

Comment thread gitlab/assets/configuration/spec.yaml
@dd-octo-sts

dd-octo-sts Bot commented Jul 17, 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 marked this pull request as draft July 17, 2026 10:37
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