opentelemetry-collector icon indicating copy to clipboard operation
opentelemetry-collector copied to clipboard

[PoC][pdata/pcommon] - Enhance FromRaw method

Open VihasMakwana opened this issue 2 months ago • 3 comments

Description

This PR enhances FromRaw method to support:

  1. slices of supported types
    • For eg. if we pass a slice of []string, it will fail. But we support the string type
  2. custom types that are maps
    • This is a special case when the user has defined a custom type, with map[string]any as the underlying type.
    • We use reflection to convert the type to map[string]any
  3. We can optionally support time.Time by 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.

VihasMakwana avatar Sep 10 '25 06:09 VihasMakwana