Skip to content

Add initial implementation of pdatagrcp#3231

Merged
bogdandrutu merged 2 commits intoopen-telemetry:mainfrom
bogdandrutu:pdatagrpc
May 19, 2021
Merged

Add initial implementation of pdatagrcp#3231
bogdandrutu merged 2 commits intoopen-telemetry:mainfrom
bogdandrutu:pdatagrpc

Conversation

@bogdandrutu
Copy link
Copy Markdown
Member

@bogdandrutu bogdandrutu commented May 19, 2021

This is needed because if we split pdata, we will nolonger be able to depend on the InternalRep or generated proto classes (raw, grpc).

The pdatagrcp will eventually be public once we stabilize the API.

The API in the pdatagrcp package is inspired from the grpc generated classes and redirects all calls to the generated classes. Some simple renames:

  • TraceService[Client|Server] -> Traces[Client|Server]
  • MetricsService[Client|Server] -> Metrics[Client|Server]
  • LogsService[Client|Server] -> Logs[Client|Server]

Other changes:

  • Replace usages of grpc generated classes in otlpexporter to excercise this new package.
  • Left some TODOs for the moment until this package is used more to determine the right API.

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

Updates #3104

@bogdandrutu bogdandrutu requested a review from a team May 19, 2021 02:25
Copy link
Copy Markdown
Contributor

@dashpole dashpole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one nit

@tigrannajaryan
Copy link
Copy Markdown
Member

@bogdandrutu Please add some notes in the PR description that clarify why this change is needed.

Copy link
Copy Markdown
Member

@tigrannajaryan tigrannajaryan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idea LGTM, just one minor question.

// LogsClient is the client API for OTLP-GRPC Logs service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type LogsClient interface {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need an interface? I assume there will be only one implementation ever. Should we simply, delete the interface and just have the struct?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can either expose the struct or the interface. I think exposing the interface is more future proof, because we can offer alternative implementations in the future. Not a big thing though, so if you feel strong I can change.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a strong opinion. Works either way.

This is needed because if we split pdata, we will nolonger be able to depend on the InternalRep or generated proto classes (raw, grpc).

The pdatagrcp will eventually be public once we stabilize the API.

The API in the pdatagrcp package is inspired from the grpc generated classes and redirects all calls to the generated classes. Some simple renames:
* TraceService[Client|Server] -> Traces[Client|Server]
* MetricsService[Client|Server] -> Metrics[Client|Server]
* LogsService[Client|Server] -> Logs[Client|Server]

Other changes:
* Replace usages of grpc generated classes in otlpexporter to excercise this new package.
* Left some TODOs for the moment until this package is used more to determine the right API.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
Copy link
Copy Markdown
Member

@tigrannajaryan tigrannajaryan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, up to you if you want to do anything about the remaining comments.

// LogsClient is the client API for OTLP-GRPC Logs service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type LogsClient interface {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a strong opinion. Works either way.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
@bogdandrutu bogdandrutu merged commit f8ad9a9 into open-telemetry:main May 19, 2021
@bogdandrutu bogdandrutu deleted the pdatagrpc branch May 19, 2021 19:44
dashpole pushed a commit to dashpole/opentelemetry-collector that referenced this pull request Jun 14, 2021
* Add initial implementation of pdatagrcp

This is needed because if we split pdata, we will nolonger be able to depend on the InternalRep or generated proto classes (raw, grpc).

The pdatagrcp will eventually be public once we stabilize the API.

The API in the pdatagrcp package is inspired from the grpc generated classes and redirects all calls to the generated classes. Some simple renames:
* TraceService[Client|Server] -> Traces[Client|Server]
* MetricsService[Client|Server] -> Metrics[Client|Server]
* LogsService[Client|Server] -> Logs[Client|Server]

Other changes:
* Replace usages of grpc generated classes in otlpexporter to excercise this new package.
* Left some TODOs for the moment until this package is used more to determine the right API.

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

* Add details for the TODOs left

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants