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

Asynchronous Aggregation storage #1232

Merged
merged 12 commits into from
Mar 11, 2022
Merged

Conversation

lalitb
Copy link
Member

@lalitb lalitb commented Feb 26, 2022

Fixes #1218

Changes

  1. Implementation for ObserverResult to be called by instrumentation library to push the measurements asynchronously.
  2. Asynchronous Storage implementation
    • During metric collection, the storage invokes the configured measurement callback, which enables the instrumentation library/application to call the ObserverResult::Observe() method and push the measurement.
    • The measurement is filtered and processed to generate the metrics.

The flow of measurement for Asynchronous instrument would be:

Metric Collection Operation -> AsynMetricStorage::Collect() -> measurement_callback(observer_result) -> ObserverResult::Observe() -> AttributeProcessor::Process() -> Aggregation::Aggregate() -> AttributeHashMap::Insert()

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@lalitb lalitb requested a review from a team February 26, 2022 06:34
@codecov
Copy link

codecov bot commented Feb 26, 2022

Codecov Report

Merging #1232 (a45f968) into main (4a7200b) will increase coverage by 0.06%.
The diff coverage is 77.91%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1232      +/-   ##
==========================================
+ Coverage   92.31%   92.37%   +0.06%     
==========================================
  Files         198      202       +4     
  Lines        7281     7335      +54     
==========================================
+ Hits         6721     6775      +54     
  Misses        560      560              
Impacted Files Coverage Δ
.../opentelemetry/sdk/metrics/measurement_processor.h 0.00% <ø> (ø)
...etry/sdk/metrics/aggregation/default_aggregation.h 14.71% <27.78%> (+14.71%) ⬆️
...ntelemetry/sdk/metrics/state/sync_metric_storage.h 67.75% <50.00%> (+13.90%) ⬆️
...telemetry/sdk/metrics/state/async_metric_storage.h 92.86% <92.86%> (ø)
...nclude/opentelemetry/sdk/metrics/observer_result.h 100.00% <100.00%> (ø)
sdk/test/metrics/async_metric_storage_test.cc 100.00% <100.00%> (ø)
sdk/test/metrics/observer_result_test.cc 100.00% <100.00%> (ø)
sdk/test/metrics/sync_metric_storage_test.cc 100.00% <100.00%> (ø)

@esigo
Copy link
Member

esigo commented Mar 9, 2022

metrics.AsyncMetricStorageTest.BasicTests is failing because of timeout.

@lalitb
Copy link
Member Author

lalitb commented Mar 10, 2022

metrics.AsyncMetricStorageTest.BasicTests is failing because of timeout.

Thanks, it was issue in the test code, have fixed it now.

Copy link
Member

@esigo esigo left a comment

Choose a reason for hiding this comment

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

LGTM
Thanks for the PR :)

@esigo esigo enabled auto-merge (squash) March 11, 2022 21:38
@esigo esigo merged commit 28bd621 into open-telemetry:main Mar 11, 2022
DebajitDas pushed a commit to DebajitDas/opentelemetry-cpp that referenced this pull request Mar 21, 2022
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.

[Metric SDK] - ASync Instruments - Aggregation Storage(s) creation for configured views.
2 participants