We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a3a5283 commit f6fb7a6Copy full SHA for f6fb7a6
opentelemetry-sdk/CHANGELOG.md
@@ -2,6 +2,10 @@
2
3
## vNext
4
5
+### Fixed
6
+
7
+- Fix metric export corruption if gauges have not received a last value. (#1363)
8
9
## v0.21.0
10
11
### Added
opentelemetry-sdk/src/metrics/internal/last_value.rs
@@ -55,8 +55,12 @@ impl<T: Number<T>> LastValue<T> {
55
pub(crate) fn compute_aggregation(&self, dest: &mut Vec<DataPoint<T>>) {
56
let mut values = match self.values.lock() {
57
Ok(guard) if !guard.is_empty() => guard,
58
- _ => return,
+ _ => {
59
+ dest.clear(); // poisoned or no values recorded yet
60
+ return;
61
+ }
62
};
63
64
let n = values.len();
65
if n > dest.capacity() {
66
dest.reserve(n - dest.capacity());
0 commit comments