[chore] processor/metricsgenerationprocessor: migrate feature gate to mdatagen#47512
Conversation
|
Thanks ! for working on this a few cl checks are currently failing
|
Add .chloggen entry for PR open-telemetry#47512 and fix import ordering in generated_package_test.go per make gogci.
|
Thanks for the feedback @jijo-OO7! I've pushed a follow-up commit that:
|
Move metricsgeneration.MatchAttributes feature gate registration from manual featuregate.GlobalRegistry().MustRegister() in processor.go to the metadata.yaml file, letting mdatagen generate the registration code. Remove the forbidigo lint exclusion for this package from .golangci.yml since it no longer uses manual feature gate registration. Fixes open-telemetry#46116
Add .chloggen entry for PR open-telemetry#47512 and fix import ordering in generated_package_test.go per make gogci.
…runs The package-level testCases slice holds pre-built pmetric.Metrics objects. The processor appends new metrics in-place, so subsequent runs under -count=3 see a progressively growing inMetrics, causing expected:3 actual:5 failures. Assisted-by: Claude Sonnet 4.6
pmetric.Metrics has no Clone method; use NewMetrics + CopyTo instead. Assisted-by: Claude Sonnet 4.6
eaaae3e to
4084a68
Compare
mx-psi
left a comment
There was a problem hiding this comment.
Just one note about the changelog, otherwise looks good!
There was a problem hiding this comment.
I think we don't need a changelog entry for this, as @jijo-OO7 suggested, could you remove this and add "[chore]" at the start of your PR name?
There was a problem hiding this comment.
Done — removed the changelog file and updated the PR title to [chore].
|
Thank you for your contribution @ogulcanaydogan! 🎉 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. |
Add .chloggen entry for PR open-telemetry#47512 and fix import ordering in generated_package_test.go per make gogci.
Add .chloggen entry for PR open-telemetry#47512 and fix import ordering in generated_package_test.go per make gogci.
Add .chloggen entry for PR open-telemetry#47512 and fix import ordering in generated_package_test.go per make gogci.
Add .chloggen entry for PR open-telemetry#47512 and fix import ordering in generated_package_test.go per make gogci.
… mdatagen (open-telemetry#47512) This PR migrates the `metricsgeneration.MatchAttributes` feature gate in `processor/metricsgenerationprocessor` from manual `featuregate.GlobalRegistry().MustRegister()` to `metadata.yaml` for mdatagen code generation, as part of open-telemetry#46116. **Changes:** - Added `feature_gates:` section to `metadata.yaml` - Ran `go generate ./...` to produce `internal/metadata/generated_feature_gates.go` and update `documentation.md` - Removed the manual `MustRegister` block from `processor.go`; updated the call site to use `metadata.MetricsgenerationMatchAttributesFeatureGate` - Updated `processor_test.go` to reference the generated gate variable - Removed the `forbidigo` lint exclusion for this package from `.golangci.yml` **Testing:** ``` go build ./... # passes go test ./... # ok github.com/open-telemetry/opentelemetry-collector-contrib/processor/metricsgenerationprocessor ```
Add .chloggen entry for PR open-telemetry#47512 and fix import ordering in generated_package_test.go per make gogci.
This PR migrates the
metricsgeneration.MatchAttributesfeature gate inprocessor/metricsgenerationprocessorfrom manualfeaturegate.GlobalRegistry().MustRegister()tometadata.yamlfor mdatagen code generation, as part of #46116.Changes:
feature_gates:section tometadata.yamlgo generate ./...to produceinternal/metadata/generated_feature_gates.goand updatedocumentation.mdMustRegisterblock fromprocessor.go; updated the call site to usemetadata.MetricsgenerationMatchAttributesFeatureGateprocessor_test.goto reference the generated gate variableforbidigolint exclusion for this package from.golangci.ymlTesting: