[chore][receiver/datadogreceiver] migrate feature gates to metadata.yaml#48905
Conversation
|
|
|
Welcome, contributor! Thank you for your contribution to opentelemetry-collector-contrib. Important reminders:
|
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Moves Datadog receiver feature-gate registration to mdatagen-driven metadata and updates code/tests to use the generated metadata gate definitions.
Changes:
- Added
feature_gatesentries tometadata.yamland generated component documentation. - Replaced in-code feature gate registration/usage with
internal/metadatafeature gate variables. - Adjusted tests to enable/disable the new metadata-defined gates via the global registry.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| receiver/datadogreceiver/receiver.go | Switches 128-bit TraceID gate check to metadata-generated feature gate |
| receiver/datadogreceiver/metadata.yaml | Defines Datadog receiver feature gates for code generation |
| receiver/datadogreceiver/internal/translator/tags.go | Removes local gate registration; uses metadata-generated MultiTagParsing gate |
| receiver/datadogreceiver/internal/translator/tags_test.go | Updates tests to reference metadata-generated gate IDs |
| receiver/datadogreceiver/documentation.md | Adds generated docs listing available feature gates |
| receiver/datadogreceiver/config.go | Removes in-code feature gate registration for 128-bit TraceIDs |
| .golangci.yml | Removes Datadog receiver-specific forbidigo exclude rule |
Files not reviewed (1)
- receiver/datadogreceiver/internal/metadata/generated_feature_gates.go: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| | Feature Gate | Stage | Description | From Version | To Version | Reference | | ||
| | ------------ | ----- | ----------- | ------------ | ---------- | --------- | | ||
| | `receiver.datadogreceiver.Enable128BitTraceID` | alpha | When enabled, adds support for 128bits TraceIDs for spans coming from Datadog instrumented services. | v0.125.0 | N/A | [Link](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/36926) | | ||
| | `receiver.datadogreceiver.EnableMultiTagParsing` | alpha | When enabled, parses `key:value` tags with duplicate keys into a slice attribute. | v0.142.0 | N/A | [Link](https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/44747) | |
There was a problem hiding this comment.
This file is generated by mdatagen, and the committed table rows use the standard single leading pipe format. I rechecked the generated file locally; there is no double-leading-pipe row to fix.
| feature_gates: | ||
| - id: receiver.datadogreceiver.Enable128BitTraceID | ||
| stage: alpha | ||
| description: When enabled, adds support for 128bits TraceIDs for spans coming from Datadog instrumented services. |
There was a problem hiding this comment.
I kept this description text unchanged from the existing manual feature gate registration to avoid changing user-visible feature gate metadata in this migration-only PR.
| feature_gates: | ||
| - id: receiver.datadogreceiver.Enable128BitTraceID | ||
| stage: alpha | ||
| description: When enabled, adds support for 128bits TraceIDs for spans coming from Datadog instrumented services. | ||
| from_version: v0.125.0 | ||
| reference_url: https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/36926 | ||
| skip_strict_validation: true | ||
|
|
||
| - id: receiver.datadogreceiver.EnableMultiTagParsing | ||
| stage: alpha | ||
| description: When enabled, parses `key:value` tags with duplicate keys into a slice attribute. | ||
| from_version: v0.142.0 | ||
| reference_url: https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/44747 | ||
| skip_strict_validation: true |
There was a problem hiding this comment.
I tested removing skip_strict_validation and mdatagen fails because these are legacy IDs with the receiver.datadogreceiver prefix, and EnableMultiTagParsing preserves the existing PR reference URL. This matches the pattern used by recent metadata migrations for legacy gates.
|
Thank you for your contribution @mangod12! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey. If you are getting started contributing, you can also join the CNCF Slack channel #opentelemetry-new-contributors to ask for guidance and get help. |
Description
Migrate the
receiver.datadogreceiver.Enable128BitTraceIDandreceiver.datadogreceiver.EnableMultiTagParsingfeature gates to be declared inmetadata.yamland code-generated viamdatagen.This follows the convention enforced by the
forbidigolinter introduced in #47506 and continues the work tracked in #46116, following the same pattern as recent migrations (#48066, #48240, #48281, #48466).No behavior change for users: the feature gate IDs, stages, descriptions,
from_versionvalues, and reference URLs are preserved. Thereceiver/datadogreceiverforbidigo exclusion is removed from.golangci.ymlbecause the component no longer manually registers feature gates outside generated metadata.Link to tracking issue
Part of #46116
Testing
From
receiver/datadogreceiver:go tool -modfile=../../internal/tools/go.mod go.opentelemetry.io/collector/cmd/mdatagen metadata.yamlCGO_ENABLED=0 go test ./...CGO_ENABLED=0 go tool -modfile=../../internal/tools/go.mod github.com/golangci/golangci-lint/v2/cmd/golangci-lint run --config ../../.golangci.yml ./...From the repository root:
goimports -w -local github.com/open-telemetry/opentelemetry-collector-contribon changed Go filesgci write -s standard -s default -s "prefix(github.com/open-telemetry/opentelemetry-collector-contrib)"on changed Go filesgit diff --checkDocumentation
receiver/datadogreceiver/documentation.mdis generated frommetadata.yamland now lists the migrated feature gates.