-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Move model pdata interfaces to pdata, expose them publicly #3455
Conversation
Why is this change needed? |
@tigrannajaryan we need a way to expose conversion to OTLP json/protobuf without exposing the internal representation. So we either keep the ToProtoBytes/FromProtoBytes funcs on all the types or expose these interfaces and the otlp implementation. I (Jay as well) thought that exposing these interfaces is better and allows us to expose other implementations like Zipkin conversions via the same interfaces. |
"go.opentelemetry.io/collector/internal" | ||
otlpcollectorlog "go.opentelemetry.io/collector/internal/data/protogen/collector/logs/v1" | ||
otlplogs "go.opentelemetry.io/collector/internal/data/protogen/logs/v1" | ||
) | ||
|
||
// This file defines in-memory data structures to represent logs. | ||
// LogsDecoder is an interface to decode bytes into protocol-specific data model. | ||
type LogsDecoder interface { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we put these marshalling/decoding/etc interfaces in a separate package or separate file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can discuss about separate files, but more importantly is do we want same package or separate? Advantage for same package is that if we also put OTLP favors in pdata we don't need the InternalRep at all
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tigrannajaryan Are you OK with having them in the same package for the reason above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are OK, I would merge the PR as is, and will followup since is a non-breaking change, just to ensure we release these interfaces in the next release so I can start using them in contrib.
@open-telemetry/collector-contrib-approvers please take a look - this change breaks contrib tests. |
Does not break contrib, it was a different PR that causes that, will rebase the PR to pass contrib tests. |
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
Signed-off-by: Bogdan Drutu bogdandrutu@gmail.com