opentelemetry-collector
opentelemetry-collector copied to clipboard
[PoC][pdata/pcommon] - Enhance FromRaw method
Description
This PR enhances FromRaw method to support:
- slices of supported types
- For eg. if we pass a slice of
[]string, it will fail. But we support thestringtype
- For eg. if we pass a slice of
- custom types that are maps
- This is a special case when the user has defined a custom type, with
map[string]anyas the underlying type. - We use reflection to convert the type to
map[string]any
- This is a special case when the user has defined a custom type, with
- We can optionally support
time.Timeby converting it to a ISO 8601 format string.
I'm happy to hear @bogdandrutu and @dmitryax's thoughts on this enhancement.
Testing
Will add testing if we decide to go forward with this change.