Skip to content

Add MinMaxSumCount and Gauge Aggregators#181

Merged
reyang merged 43 commits into
open-telemetry:masterfrom
Brandon-Kimberly:mmsc-gauge-agg
Jul 30, 2020
Merged

Add MinMaxSumCount and Gauge Aggregators#181
reyang merged 43 commits into
open-telemetry:masterfrom
Brandon-Kimberly:mmsc-gauge-agg

Conversation

@Brandon-Kimberly
Copy link
Copy Markdown
Contributor

This PR builds out SDK support for the MinMaxSumCount and Gauge Aggregators which combine updates to metric instruments in meaningful values. Each aggregator stores exportable values in a vector format for ease of use further down the metrics data pipeline. All aggregators are derived from a base Aggregator abstract class which holds functions and data relevant to all aggregators. Additional data structures, such as a vector for histogram boundaries, are added on a case by case basis. Aggregators are dependent on the Metric Instruments API (pending approval in PR #161) and will not compile without those files. Additionally, these aggregators depend on the base Aggregator interface in PR #178.

Also included are tests for each aggregator which validate the correctness of aggregation in both single-threaded and concurrent situations.

Note: We templated aggregators to support a wider array of scalar types. This templating prevents us from using out of line declarations as we normally would. As a result, we left all implementation code in the header file. If there are any suggestions to remedy this we will gladly make the change.

This PR is part of a series of PRs to add a full implementation of metrics API and SDK support.

@Brandon-Kimberly Brandon-Kimberly requested a review from a team July 16, 2020 16:13
Comment thread sdk/include/opentelemetry/sdk/metrics/gauge_aggregator.h Outdated
Comment thread sdk/include/opentelemetry/sdk/metrics/gauge_aggregator.h Outdated
Comment thread sdk/include/opentelemetry/sdk/metrics/min_max_sum_count_aggregator.h Outdated
Comment thread sdk/include/opentelemetry/sdk/metrics/min_max_sum_count_aggregator.h Outdated
Copy link
Copy Markdown
Member

@reyang reyang left a comment

Choose a reason for hiding this comment

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

LGTM with minor comments.

@reyang reyang added the pr:do-not-merge This PR is not ready to be merged. label Jul 18, 2020
Also changed enum in ctor to InstrumentKind to support new version of the Aggregator class in PR #178
This is to keep up with the update Aggregator class in PR  #178
Accidental copy-paste of InstrumentKind arg meant the test was not actually conducting a bad merge but rather, a perfectly valid merge.
Accidental copy-paste of InstrumentKind arg meant the test was not actually conducting a bad merge but rather, a perfectly valid merge.
@reyang reyang added pr:please-merge This PR is ready to be merged by a Maintainer (rebased, CI passed, has enough valid approvals, etc.) and removed pr:do-not-merge This PR is not ready to be merged. labels Jul 28, 2020
@reyang
Copy link
Copy Markdown
Member

reyang commented Jul 29, 2020

This PR has conflicts that need to be resolved before merge.

@reyang
Copy link
Copy Markdown
Member

reyang commented Jul 29, 2020

@Brandon-Kimberly please look into the CI failures.

@Brandon-Kimberly
Copy link
Copy Markdown
Contributor Author

@Brandon-Kimberly please look into the CI failures.

I just updated my code to ensure that the format test passes. The others are currently failing because this code is dependent on code in PR #178, namely the base Aggregator class.

Brandon-Kimberly and others added 5 commits July 29, 2020 18:05
@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 30, 2020

Codecov Report

Merging #181 into master will increase coverage by 0.09%.
The diff coverage is 98.41%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #181      +/-   ##
==========================================
+ Coverage   93.75%   93.84%   +0.09%     
==========================================
  Files         104      109       +5     
  Lines        3249     3512     +263     
==========================================
+ Hits         3046     3296     +250     
- Misses        203      216      +13     
Impacted Files Coverage Δ
.../metrics/aggregator/min_max_sum_count_aggregator.h 93.47% <93.47%> (ø)
...elemetry/sdk/metrics/aggregator/gauge_aggregator.h 97.22% <97.22%> (ø)
sdk/test/metrics/gauge_aggregator_test.cc 100.00% <100.00%> (ø)
.../test/metrics/min_max_sum_count_aggregator_test.cc 100.00% <100.00%> (ø)
.../opentelemetry/sdk/metrics/aggregator/aggregator.h 18.18% <0.00%> (ø)

@Brandon-Kimberly
Copy link
Copy Markdown
Contributor Author

@reyang I believe this PR is ready to merge :)

@reyang reyang merged commit 4caf0bb into open-telemetry:master Jul 30, 2020
ziqizh pushed a commit to ziqizh/opentelemetry-cpp that referenced this pull request Jul 31, 2020
ziqizh pushed a commit to ziqizh/opentelemetry-cpp that referenced this pull request Jul 31, 2020
GerHobbelt pushed a commit to GerHobbelt/opentelemetry-cpp that referenced this pull request Jun 17, 2025
…s-create-or-update-comment-digest

Update peter-evans/create-or-update-comment digest to 54ad810
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:please-merge This PR is ready to be merged by a Maintainer (rebased, CI passed, has enough valid approvals, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants