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

Refactor metric format #2658

Merged
merged 16 commits into from
May 12, 2022
Merged

Refactor metric format #2658

merged 16 commits into from
May 12, 2022

Conversation

ocelotl
Copy link
Contributor

@ocelotl ocelotl commented May 4, 2022

Fixes #2646

This PR has been refactored completely to address this comment.

Since this is a big PR, here is some information to help review:

This PR basically unflattens this Metric object to make it match the OTLP Metric object, and it is implemented here.

This means, our Metric object now contains a Sum, Histogram or Gauge object and those objects now contain a series of NumberDataPoint or HistogramDataPoint objects as defined by the proto.

This changes many things but it is pretty much just a rearranging of data. The only "significant" change is that it was necessary to remove _convert_aggregation_temporality, this conversion has been split and moved into each aggregation collect method. I find it better since we now don't have all the ifs that did something different depending on the point type but instead that specific code is moved into each aggregation that matches the corresponding point type.

@ocelotl ocelotl requested a review from a team May 4, 2022 02:59
@ocelotl ocelotl added the Skip Changelog PRs that do not require a CHANGELOG.md entry label May 4, 2022
@ocelotl ocelotl force-pushed the issue_2646 branch 2 times, most recently from 7c5b6da to fe55d5c Compare May 6, 2022 02:10
@ocelotl ocelotl marked this pull request as ready for review May 11, 2022 01:28
@ocelotl ocelotl requested a review from srikanthccv May 11, 2022 17:07
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.

LGTM, just one question about logic change in point by label set

@ocelotl ocelotl requested a review from srikanthccv May 11, 2022 19:19
Copy link
Member

@aabmass aabmass left a comment

Choose a reason for hiding this comment

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

Nice, this was a big effort! 🙂

I think I found a few bugs, but sorry for all the comments.

@ocelotl ocelotl requested a review from aabmass May 12, 2022 20:41
Copy link
Member

@aabmass aabmass left a comment

Choose a reason for hiding this comment

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

LGTM

@ocelotl ocelotl merged commit e8fbb08 into open-telemetry:main May 12, 2022
@ocelotl ocelotl deleted the issue_2646 branch May 12, 2022 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skip Changelog PRs that do not require a CHANGELOG.md entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor Metric object format
3 participants