Skip to content

[chore][receiver/datadogreceiver] migrate feature gates to metadata.yaml#48905

Merged
MovieStoreGuy merged 1 commit into
open-telemetry:mainfrom
mangod12:oss/datadogreceiver-metadata-feature-gates
Jun 12, 2026
Merged

[chore][receiver/datadogreceiver] migrate feature gates to metadata.yaml#48905
MovieStoreGuy merged 1 commit into
open-telemetry:mainfrom
mangod12:oss/datadogreceiver-metadata-feature-gates

Conversation

@mangod12

@mangod12 mangod12 commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Description

Migrate the receiver.datadogreceiver.Enable128BitTraceID and receiver.datadogreceiver.EnableMultiTagParsing feature gates to be declared in metadata.yaml and code-generated via mdatagen.

This follows the convention enforced by the forbidigo linter 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_version values, and reference URLs are preserved. The receiver/datadogreceiver forbidigo exclusion is removed from .golangci.yml because 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.yaml
  • CGO_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-contrib on changed Go files
  • gci write -s standard -s default -s "prefix(github.com/open-telemetry/opentelemetry-collector-contrib)" on changed Go files
  • git diff --check

Documentation

receiver/datadogreceiver/documentation.md is generated from metadata.yaml and now lists the migrated feature gates.

@mangod12 mangod12 requested a review from MovieStoreGuy as a code owner June 7, 2026 15:42
Copilot AI review requested due to automatic review settings June 7, 2026 15:42
@mangod12 mangod12 requested a review from a team as a code owner June 7, 2026 15:42
@linux-foundation-easycla

linux-foundation-easycla Bot commented Jun 7, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: mangod12 / name: mangod12 (a40592d)

@github-actions github-actions Bot added the first-time contributor PRs made by new contributors label Jun 7, 2026
@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Welcome, contributor! Thank you for your contribution to opentelemetry-collector-contrib.

Important reminders:

  • Read our Contributing Guidelines.
  • Sign the CLA if you haven't already.
  • First-time contributors should have at most one PR not marked as draft until their first PR is merged.
  • If your change isn't one of our priority components, reviews may take more time.
  • Give reviewers at least a few days before pinging them for feedback.
  • If you need help or struggle to move your PR forward:

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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_gates entries to metadata.yaml and generated component documentation.
  • Replaced in-code feature gate registration/usage with internal/metadata feature 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.

Comment on lines +9 to +12
| 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) |

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Comment on lines +17 to +30
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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Comment thread receiver/datadogreceiver/receiver.go
@MovieStoreGuy MovieStoreGuy merged commit 699a766 into open-telemetry:main Jun 12, 2026
213 checks passed
@otelbot

otelbot Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

first-time contributor PRs made by new contributors receiver/datadog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants