[chore][connector/spanmetrics]: migrate fgs to metadata#48281
Conversation
5c5b708 to
0bd144c
Compare
|
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. |
There was a problem hiding this comment.
Please, remove this TODO. It is supposed feature gates should be removed after their purpose.
| - linters: | ||
| - forbidigo | ||
| path: connector/spanmetricsconnector/ |
There was a problem hiding this comment.
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.
|
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. |
) #### 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>
…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`
…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>
Description
metadata.yaml. Kept comments/TODO intact as I assumed they were committed for a reason in the first place.from_versionfor each gate was determined viagit describe --contains <commit>on the commit that introduced it:connector.spanmetrics.legacyMetricNames→v0.109.0([connector/spanmetrics] Improve consistency between metrics generated by spanmetricsconnector #34485)connector.spanmetrics.includeCollectorInstanceID→v0.136.0([connector/spanmetrics] Support inserting collector.instance.id as an attribute to spanmetrics metrics #41865)connector.spanmetrics.useSecondAsDefaultMetricsUnit→v0.137.0([spanmetricsconnector]Change default duration metrics unit frommstos#42761)connector.spanmetrics.excludeResourceMetrics→v0.137.0([connector/spanmetrics] exclude all resource attributes in spanmetrics #42760)spanmetrics.statusCodeConvention.useOtelPrefix→v0.141.0([connector/spanmetrics] Use latest semantic conventions for status code attribute #43000)spanmetrics.statusCodeConvention.useOtelPrefixhad noreference_urlin the original registration, so I used the implementing PR as the reference URL as the issue was only partially fixed.connector_test.goalready importsgoogle.golang.org/grpc/metadata, so the internalmetadatapackage was imported with the aliasspanmetricsmetadatato avoid a name conflictLink to tracking issue
Part of #46116
Testing
makein the component directorymake gogciin root dirDocumentation
connector/spanmetricsconnector/documentation.mdwas generated viamake generate