Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore][encoding/jaegerencodingextension] add marshaler to follow the codec interfaces #28639

Closed

Conversation

VihasMakwana
Copy link
Contributor

@VihasMakwana VihasMakwana commented Oct 26, 2023

Description: Add marshaler to follow the codec interfaces. We don't know how to marshal in this case so I'm leaving it as "unsupported"

@VihasMakwana VihasMakwana requested a review from a team October 26, 2023 09:55
@VihasMakwana VihasMakwana changed the title [encoding/jaegerencodingextension] add marshaler to follow the codec interfaces [chore][encoding/jaegerencodingextension] add marshaler to follow the codec interfaces Oct 26, 2023
@songy23 songy23 added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Oct 26, 2023
@dmitryax
Copy link
Member

dmitryax commented Oct 26, 2023

Why is this needed? Exporters will be looking at MarshalTraces implementation. If it's not there, it'll be Start time error, which is better than Consume time error

It's ok to have decoding OR encoding extensions.

@atoulme
Copy link
Contributor

atoulme commented Oct 26, 2023

Indeed, let's just not implement it.

@atoulme
Copy link
Contributor

atoulme commented Oct 26, 2023

It's completely ok if we only support unmarshaling from jaeger. Just that is useful for most components out there.

@VihasMakwana
Copy link
Contributor Author

VihasMakwana commented Oct 27, 2023

@dmitryax @atoulme I thought we'd follow based on this comment

package codec

type Metric interface {
    pmetric.Marshaler
    pmetric.Unmarshaler
}

type Log interface {
    plog.Marshaler
    plog.Unmarshaler
}

type Trace interface {
    ptrace.Marshaler
    ptrace.Unmarshaler
}

It turns out we don't need to, receivers can do the following:

if ext, ok := extensions[componentID]; ok {
  if enc, ok := ext.(Unmarshler); ok {
	  return enc, nil
  }
  ... error
}

and exporters can do the following:

if ext, ok := extensions[componentID]; ok {
  if enc, ok := ext.(Marshler); ok {
	  return enc, nil
  }
  ... error
}

Please let me know if I'm wrong.

Sorry for any inconvenience, I'll be closing this PR as it's not needed. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension/encoding/jaegerencoding Skip Changelog PRs that do not require a CHANGELOG.md entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants