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

Separate protobuf encoding into a separate package #3169

Conversation

jack-burridge-cfh
Copy link
Contributor

@jack-burridge-cfh jack-burridge-cfh commented Feb 9, 2023

Description

This separates Protobuf encoding into a separate package opentelemetry-exporter-otlp-proto-common which is then used by:

  • opentelemetry-exporter-otlp-proto-grpc
  • opentelemetry-exporter-otlp-proto-http

Fixes #3160

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Tests have been moved from opentelemetry-exporter-otlp-proto-grpc and opentelemetry-exporter-otlp-proto-http to the new package

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@jack-burridge-cfh jack-burridge-cfh requested a review from a team February 9, 2023 08:51
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Feb 9, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

@jack-burridge-cfh jack-burridge-cfh marked this pull request as draft February 9, 2023 08:51
Copy link
Contributor Author

@jack-burridge-cfh jack-burridge-cfh left a comment

Choose a reason for hiding this comment

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

I've also noticed that all log packaged are protected, as in start with _log should this also happen in the common package?

@jack-burridge-cfh jack-burridge-cfh force-pushed the 3160-separate-protobuf-encoding-into-a-separate-package branch from 5547c24 to c70248c Compare February 14, 2023 16:36
@jack-burridge-cfh jack-burridge-cfh marked this pull request as ready for review February 14, 2023 16:37
@jack-burridge-cfh jack-burridge-cfh force-pushed the 3160-separate-protobuf-encoding-into-a-separate-package branch from c70248c to beb7cc2 Compare February 15, 2023 12:06
@srikanthccv srikanthccv self-assigned this Feb 28, 2023
@jack-burridge-cfh
Copy link
Contributor Author

@lzchen @srikanthccv I'm not entirely sure on the namings, at the moment I've added the encoders as:

  • opentelemetry.exporter.otlp.proto.common.log_encoder.encode_logs
  • opentelemetry.exporter.otlp.proto.common.metrics_encoder.encode_metrics
  • opentelemetry.exporter.otlp.proto.common.trace_encoder.encode_spans

But I am now thinking:

  • opentelemetry.exporter.otlp.proto.common._log_encoder.encode
  • opentelemetry.exporter.otlp.proto.common.metric_encoder.encode
  • opentelemetry.exporter.otlp.proto.common.trace_encoder.encode

@jack-burridge-cfh jack-burridge-cfh force-pushed the 3160-separate-protobuf-encoding-into-a-separate-package branch from beb7cc2 to fcfbd68 Compare March 2, 2023 13:39
@jack-burridge-cfh jack-burridge-cfh force-pushed the 3160-separate-protobuf-encoding-into-a-separate-package branch from e91877c to e4aa80f Compare March 22, 2023 16:39
@srikanthccv
Copy link
Member

@jack-burridge-cfh you can resolve the outdated conversation if you believe the comment is addressed. I will take a look at the PR again.

@jack-burridge-cfh
Copy link
Contributor Author

@jack-burridge-cfh you can resolve the outdated conversation if you believe the comment is addressed. I will take a look at the PR again.

Done

@jack-burridge-cfh
Copy link
Contributor Author

@srikanthccv The issues with the checks seem to be git-based ones which I can't reproduce locally, so I don't know how to fix those

@lzchen
Copy link
Contributor

lzchen commented Mar 27, 2023

@jack-burridge-cfh
Sorry about the inconvenience. Builds seem to be failing (not related to your PR). We have a tracking issue here and will work to resolve it asap. In the meantime, we will be reviewing your PR :)

@jack-burridge-cfh jack-burridge-cfh force-pushed the 3160-separate-protobuf-encoding-into-a-separate-package branch 3 times, most recently from ce2d186 to 7a746ae Compare March 31, 2023 09:54
@jack-burridge-cfh
Copy link
Contributor Author

I ran markdown-link-check locally and can't reproduce the error so looks like the server was just down when it was doing the check

@srikanthccv
Copy link
Member

Overall LGTM. I am thinking about the import paths. It seems like one would end up using aliases if they want to use encoders.

opentelemetry.exporter.otlp.proto.common.metrics_encoder import encode as metrics_encode
opentelemetry.exporter.otlp.proto.common.trace_encoder import encode as trace_encode

@jack-burridge-cfh
Copy link
Contributor Author

Overall LGTM. I am thinking about the import paths. It seems like one would end up using aliases if they want to use encoders.

opentelemetry.exporter.otlp.proto.common.metrics_encoder import encode as metrics_encode
opentelemetry.exporter.otlp.proto.common.trace_encoder import encode as trace_encode

The decision here was a conscious one, basically most uses will not involve multiple types of encoders, and encourages you to keep them separate. I honestly cannot think of a reason you would, it's more likely an edge case. Like they are used here the encoders are likely to be used to write different types of exporters (Kafka etc) and these exporters are likely to be in different files.

@srikanthccv
Copy link
Member

We have been explicit and verbose in the project. You can see it in many places in the project, including the exporters (OTLPSpanExporter, OTLPMetricExporter). And let's be explicit here as well.

@jack-burridge-cfh jack-burridge-cfh force-pushed the 3160-separate-protobuf-encoding-into-a-separate-package branch from 7a746ae to 96fe119 Compare April 2, 2023 14:34
@jack-burridge-cfh
Copy link
Contributor Author

We have been explicit and verbose in the project. You can see it in many places in the project, including the exporters (OTLPSpanExporter, OTLPMetricExporter). And let's be explicit here as well.

Fair point. Done 😄

@srikanthccv
Copy link
Member

LGTM from my side, I will let other approvers take a look once and then merge if they don't have any objections. Thank you for your continuous effort to for addressing the comments and get this merged.

@jack-burridge-cfh jack-burridge-cfh force-pushed the 3160-separate-protobuf-encoding-into-a-separate-package branch from e827f58 to 0322c32 Compare April 4, 2023 07:58
@jack-burridge-cfh jack-burridge-cfh force-pushed the 3160-separate-protobuf-encoding-into-a-separate-package branch from 0322c32 to 76a87f1 Compare April 5, 2023 08:22
@jack-burridge-cfh jack-burridge-cfh force-pushed the 3160-separate-protobuf-encoding-into-a-separate-package branch from 76a87f1 to 179a697 Compare April 5, 2023 08:23
@jack-burridge-cfh jack-burridge-cfh force-pushed the 3160-separate-protobuf-encoding-into-a-separate-package branch from 179a697 to 82a1075 Compare April 5, 2023 09:32
Copy link
Member

@srikanthccv srikanthccv left a comment

Choose a reason for hiding this comment

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

Solid refactoring! Thank you.

@jack-burridge-cfh
Copy link
Contributor Author

Solid refactoring! Thank you.

It's why I use PyCharm 😄 It may be cumbersome but the refactoring is fantastic

@jack-burridge-cfh
Copy link
Contributor Author

@srikanthccv Any reason this cant be merged? or are we waiting for more people to look at it because of the scope of the change?

@lzchen lzchen merged commit c46ad86 into open-telemetry:main Apr 5, 2023
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.

Separate Protobuf encoding into a separate package
4 participants