Skip to content

Add Finish on synchronous instruments#8050

Draft
MrAlias wants to merge 6 commits intoopen-telemetry:mainfrom
MrAlias:sync-inst-finish
Draft

Add Finish on synchronous instruments#8050
MrAlias wants to merge 6 commits intoopen-telemetry:mainfrom
MrAlias:sync-inst-finish

Conversation

@MrAlias
Copy link
Contributor

@MrAlias MrAlias commented Mar 11, 2026

Supersedes #7541

WIP/POC implementation to support open-telemetry/opentelemetry-specification#2232

@codecov
Copy link

codecov bot commented Mar 11, 2026

Codecov Report

❌ Patch coverage is 91.61677% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.7%. Comparing base (aff375a) to head (4f81ca7).

Files with missing lines Patch % Lines
sdk/metric/internal/aggregate/histogram.go 76.4% 3 Missing and 1 partial ⚠️
sdk/metric/internal/aggregate/lastvalue.go 83.3% 3 Missing and 1 partial ⚠️
sdk/metric/internal/aggregate/sum.go 83.3% 3 Missing and 1 partial ⚠️
sdk/metric/internal/aggregate/atomic.go 93.3% 1 Missing ⚠️
...metric/internal/aggregate/exponential_histogram.go 93.3% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff           @@
##            main   #8050    +/-   ##
======================================
  Coverage   81.6%   81.7%            
======================================
  Files        304     304            
  Lines      23425   23558   +133     
======================================
+ Hits       19130   19248   +118     
- Misses      3907    3919    +12     
- Partials     388     391     +3     
Files with missing lines Coverage Δ
internal/global/instruments.go 57.4% <100.0%> (+6.2%) ⬆️
metric/instrument.go 100.0% <100.0%> (ø)
metric/noop/noop.go 100.0% <100.0%> (ø)
metric/syncfloat64.go 100.0% <ø> (ø)
metric/syncint64.go 100.0% <ø> (ø)
sdk/metric/instrument.go 97.8% <100.0%> (+0.2%) ⬆️
sdk/metric/internal/aggregate/aggregate.go 100.0% <100.0%> (ø)
sdk/metric/meter.go 92.1% <100.0%> (ø)
sdk/metric/internal/aggregate/atomic.go 88.8% <93.3%> (+0.6%) ⬆️
...metric/internal/aggregate/exponential_histogram.go 97.1% <93.3%> (-0.3%) ⬇️
... and 3 more

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@MrAlias
Copy link
Contributor Author

MrAlias commented Mar 12, 2026

SIG meeting feedback:

  • It would likely be useful to users if they can provide an allow/deny list of attributes
  • In the SDK we likely want to mark "finished" and make the final export of that data (tombstoning with appropriate re-up if users restart within the cycle).
  • This will cumulative start-time update is needed. @dashpole will look to add that separately in another PR behind a feature gate.

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.

2 participants