[connector/count] Support all attribute types#43768
[connector/count] Support all attribute types#43768atoulme merged 2 commits intoopen-telemetry:mainfrom
Conversation
The count connector currently implements its own parsing and copying logic for attributes. This means that attributes with non-supported types (e.g. booleans) are converted to the empty string. We replace this custom logic with a more standard CopyTo and FromRaw.
|
Welcome, contributor! Thank you for your contribution to opentelemetry-collector-contrib. Important reminders:
A maintainer will review your pull request soon. Thank you for helping make OpenTelemetry better! |
bfdecc8 to
fef184f
Compare
|
Welcome, contributor! Thank you for your contribution to opentelemetry-collector-contrib. Important reminders:
A maintainer will review your pull request soon. Thank you for helping make OpenTelemetry better! |
|
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
|
It's not stale, it's waiting for review. |
| } | ||
|
|
||
| func (i *MetricInfo) validateAttributes() error { | ||
| tmp := pcommon.NewValueEmpty() |
There was a problem hiding this comment.
nit: This naming is a bit strange to me but I do see the same convention used in another component doing the same validation
|
Looks like we need a maintainer to get the checks to run |
Well, I don't think that's caused by me. I have merged in master to see if that helps. |
|
Thank you for your contribution @SquidDev! 🎉 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
The count connector currently implements its own parsing and copying logic for attributes. This means that attributes with non-supported types (e.g. booleans) are converted to the empty string.
We replace this custom logic with a more standard
CopyToandFromRaw.Testing
All existing tests pass unchanged. There is a new test that asserts common attribute types (string, int, double, bool) can be copied.