Skip to content

[chore][connector/spanmetrics]: migrate fgs to metadata#48281

Merged
codeboten merged 2 commits into
open-telemetry:mainfrom
kb-newrelic:chore/migrate-fgs-to-meta-spanmetricsconnector
May 15, 2026
Merged

[chore][connector/spanmetrics]: migrate fgs to metadata#48281
codeboten merged 2 commits into
open-telemetry:mainfrom
kb-newrelic:chore/migrate-fgs-to-meta-spanmetricsconnector

Conversation

@kb-newrelic
Copy link
Copy Markdown
Contributor

Description

Link to tracking issue

Part of #46116

Testing

  • make in the component directory
  • make gogci in root dir

Documentation

  • connector/spanmetricsconnector/documentation.md was generated via make generate

@kb-newrelic kb-newrelic force-pushed the chore/migrate-fgs-to-meta-spanmetricsconnector branch from 5c5b708 to 0bd144c Compare May 11, 2026 22:57
@kb-newrelic
Copy link
Copy Markdown
Contributor Author

Rebased to take advantage of #48231 which fixed a failing codeowner check

from_version: v0.136.0
reference_url: https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/40400

# TODO: Remove this feature gate when the legacy metric names are removed.
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.

Please, remove this TODO. It is supposed feature gates should be removed after their purpose.

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.

Done!

Comment thread .golangci.yml
Comment on lines -128 to -130
- linters:
- forbidigo
path: connector/spanmetricsconnector/
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.

Why?

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 rule was added as part of #47506 which was done in preparation for #46116, see also last line of issue description

The list of components that still have manually written feature gates are: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/.golangci.yml#L124

Linting would fail (on main) without this rule because the connector still uses manually written feature gate code. The PR migrates the FGs to metadata, making the rule unnecessary.

@codeboten codeboten merged commit 3b0660a into open-telemetry:main May 15, 2026
193 checks passed
@otelbot
Copy link
Copy Markdown
Contributor

otelbot Bot commented May 15, 2026

Thank you for your contribution @kb-newrelic! 🎉 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.

mx-psi pushed a commit that referenced this pull request May 19, 2026
)

#### Description

Migrate the `exporter.signalfx.consumeEntityEvents` feature gate to be
declared in `metadata.yaml` and code-generated via `mdatagen`, matching
the convention enforced by the `forbidigo` linter introduced in #47506.

This continues the work tracked in #46116, following the same pattern as
recent migrations (#48066, #48240, #48281, #47893).

No behavior change for users: the feature gate ID, stage, description,
and `from_version` are preserved exactly. A `reference_url` was added
pointing to the PR that introduced the gate (#45595), which is required
by mdatagen.

#### Link to tracking issue

Updates #46116

#### Testing

From `exporter/signalfxexporter`:
- `make mdatagen` — clean re-generation, no diff after `make fmt && make
gci`.
- `go build ./...` — passes.
- `go test ./... -count=1` — passes.
- `golangci-lint run --config=<repo>/.golangci.yml ./...` (v2.7) —
clean.

#### Documentation

`documentation.md` is now generated from `metadata.yaml` and lists the
feature gate.

Signed-off-by: iahsanGill <mgill.bese22seecs@seecs.edu.pk>
ben-trans pushed a commit to ben-trans/opentelemetry-collector-contrib that referenced this pull request May 25, 2026
…ry#48281)

#### Description
- Migrate programatically registered feature gates to `metadata.yaml`.
Kept comments/TODO intact as I assumed they were committed for a reason
in the first place.
- `from_version` for each gate was determined via `git describe
--contains <commit>` on the commit that introduced it:
  - `connector.spanmetrics.legacyMetricNames` → `v0.109.0` (open-telemetry#34485)
- `connector.spanmetrics.includeCollectorInstanceID` → `v0.136.0`
(open-telemetry#41865)
- `connector.spanmetrics.useSecondAsDefaultMetricsUnit` → `v0.137.0`
(open-telemetry#42761)
  - `connector.spanmetrics.excludeResourceMetrics` → `v0.137.0` (open-telemetry#42760)
- `spanmetrics.statusCodeConvention.useOtelPrefix` → `v0.141.0` (open-telemetry#43000)
- `spanmetrics.statusCodeConvention.useOtelPrefix` had no
`reference_url` in the original registration, so I used the implementing
PR as the reference URL as the issue was only partially fixed.
- `connector_test.go` already imports `google.golang.org/grpc/metadata`,
so the internal `metadata` package was imported with the alias
`spanmetricsmetadata` to avoid a name conflict

#### Link to tracking issue
Part of open-telemetry#46116

#### Testing
- `make` in the component directory
- `make gogci` in root dir

#### Documentation
- `connector/spanmetricsconnector/documentation.md` was generated via
`make generate`
ben-trans pushed a commit to ben-trans/opentelemetry-collector-contrib that referenced this pull request May 25, 2026
…n-telemetry#48466)

#### Description

Migrate the `exporter.signalfx.consumeEntityEvents` feature gate to be
declared in `metadata.yaml` and code-generated via `mdatagen`, matching
the convention enforced by the `forbidigo` linter introduced in open-telemetry#47506.

This continues the work tracked in open-telemetry#46116, following the same pattern as
recent migrations (open-telemetry#48066, open-telemetry#48240, open-telemetry#48281, open-telemetry#47893).

No behavior change for users: the feature gate ID, stage, description,
and `from_version` are preserved exactly. A `reference_url` was added
pointing to the PR that introduced the gate (open-telemetry#45595), which is required
by mdatagen.

#### Link to tracking issue

Updates open-telemetry#46116

#### Testing

From `exporter/signalfxexporter`:
- `make mdatagen` — clean re-generation, no diff after `make fmt && make
gci`.
- `go build ./...` — passes.
- `go test ./... -count=1` — passes.
- `golangci-lint run --config=<repo>/.golangci.yml ./...` (v2.7) —
clean.

#### Documentation

`documentation.md` is now generated from `metadata.yaml` and lists the
feature gate.

Signed-off-by: iahsanGill <mgill.bese22seecs@seecs.edu.pk>
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.

3 participants