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

sdk/metric: Remove Reader.ForceFlush and ManualReader.ForceFlush #4375

Merged
merged 12 commits into from
Aug 11, 2023

Conversation

pellared
Copy link
Member

@pellared pellared commented Jul 27, 2023

Why

The Reader.ForceFlush and ManualReader.ForceFlush are not needed and we can remove it to make the user-facing API cleaner. E.g. we do not need the Prometheus exporter to have ForceFlush (via type embedding of metric.Reader). ForceFlush is only required when periodic reader is used. This change is now possible after #4244.

The OTel Specification does NOT require to require to haveReader.ForceFlush. For instance the OTel .NET SDK readers do not implement ForceFlush at all.

Related PRs and issues in specification:

What

Remove Reader.ForceFlush and ManualReader.ForceFlush. Use type assertions so that ForceFlush is properly handled by the MetricProvider.

@pellared pellared changed the title Remove Reader.ForceFlush and ManualReader.ForceFlush Proposal: Remove Reader.ForceFlush and ManualReader.ForceFlush Jul 27, 2023
@pellared pellared changed the title Proposal: Remove Reader.ForceFlush and ManualReader.ForceFlush [proposal] Remove Reader.ForceFlush and ManualReader.ForceFlush Jul 27, 2023
@pellared pellared changed the title [proposal] Remove Reader.ForceFlush and ManualReader.ForceFlush [proposal] sdk/metric: Remove Reader.ForceFlush and ManualReader.ForceFlush Jul 27, 2023
@codecov
Copy link

codecov bot commented Jul 27, 2023

Codecov Report

Merging #4375 (ab36e83) into main (c513972) will increase coverage by 0.0%.
The diff coverage is 100.0%.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #4375   +/-   ##
=====================================
  Coverage   78.8%   78.8%           
=====================================
  Files        253     253           
  Lines      20645   20644    -1     
=====================================
+ Hits       16280   16283    +3     
+ Misses      4016    4012    -4     
  Partials     349     349           
Files Changed Coverage Δ
sdk/metric/manual_reader.go 76.4% <ø> (-0.4%) ⬇️
sdk/metric/provider.go 100.0% <ø> (ø)
sdk/metric/reader.go 100.0% <ø> (ø)
sdk/metric/config.go 94.6% <100.0%> (+<0.1%) ⬆️

... and 2 files with indirect coverage changes

@MrAlias
Copy link
Contributor

MrAlias commented Jul 27, 2023

@pellared pellared added the blocked:specification Waiting on clarification of the OpenTelemetry specification before progress can be made label Jul 27, 2023
Copy link
Contributor

@MrAlias MrAlias left a comment

Choose a reason for hiding this comment

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

LGTM pending the acceptance at the specification level.

@pellared
Copy link
Member Author

pellared commented Jul 30, 2023

There is no consensus on specification PR, but I looks like all objections are NOT related to changes proposed in this PR. E.g. see: open-telemetry/opentelemetry-specification#3609 (review).

Still, I prefer to wait and consider it as blocked.

@pellared pellared removed the blocked:specification Waiting on clarification of the OpenTelemetry specification before progress can be made label Aug 1, 2023
@pellared
Copy link
Member Author

pellared commented Aug 2, 2023

Now blocked on open-telemetry/opentelemetry-specification#3563

PS. During the last specification SIG meeting nobody was against this approach.

@pellared pellared changed the title [proposal] sdk/metric: Remove Reader.ForceFlush and ManualReader.ForceFlush sdk/metric: Remove Reader.ForceFlush and ManualReader.ForceFlush Aug 9, 2023
@pellared
Copy link
Member Author

pellared commented Aug 9, 2023

open-telemetry/opentelemetry-specification#3563 is merged 🎉
This PR can be merged.

CHANGELOG.md Outdated Show resolved Hide resolved
pellared and others added 2 commits August 11, 2023 09:02
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
@pellared pellared added pkg:SDK Related to an SDK package area:metrics Part of OpenTelemetry Metrics labels Aug 11, 2023
@pellared pellared merged commit a9552aa into open-telemetry:main Aug 11, 2023
25 checks passed
@pellared pellared deleted the remove-reader-forceflush branch August 11, 2023 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:metrics Part of OpenTelemetry Metrics pkg:SDK Related to an SDK package
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

4 participants