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

Move model pdata interfaces to pdata, expose them publicly #3455

Merged
merged 1 commit into from
Jun 22, 2021

Conversation

bogdandrutu
Copy link
Member

Signed-off-by: Bogdan Drutu bogdandrutu@gmail.com

@bogdandrutu bogdandrutu requested review from a team and jpkrohling June 16, 2021 15:39
@tigrannajaryan
Copy link
Member

Why is this change needed?

@bogdandrutu
Copy link
Member Author

@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 {
Copy link
Member

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?

Copy link
Member Author

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

Copy link
Member Author

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?

Copy link
Member Author

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.

@punya
Copy link
Member

punya commented Jun 18, 2021

@open-telemetry/collector-contrib-approvers please take a look - this change breaks contrib tests.

@bogdandrutu
Copy link
Member Author

@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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants