Skip to content

Commit 28d0de2

Browse files
author
Memfault Inc
committed
memfaultd 1.17.0 (Build 2808159)
1 parent deae7c0 commit 28d0de2

File tree

50 files changed

+942
-104
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+942
-104
lines changed

CHANGELOG.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,46 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to
77
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
88

9+
## [1.17.0] - 2024-01-16
10+
This release introduces the new `memfaultctl write-metrics` command
11+
as well as some important bugfixes.
12+
13+
### Added
14+
- `memfaultctl write-metrics`, which allows users to write
15+
metrics to `memfaultd` from a script or shell by specifying
16+
them as arguments to the command in the form `KEY=VALUE`.
17+
- 2 new built-in system metrics under the new `diskstats`
18+
metric category. These metrics follow the naming pattern
19+
`diskstats/<device name>/reads_per_second` and
20+
`diskstats/<device name>/writes_per_second` where
21+
`<device name>` is the name of a device listed in
22+
`/proc/diskstats`. The list of devices monitored
23+
can be configured with the `metrics.system_metric_collection.diskstats`
24+
configuration field.
25+
26+
### Changed
27+
- The log message emitted when the MAR cleaner
28+
encounters an invalid MAR entry in the MAR
29+
staging area has been lowered from `WARN` level
30+
to `DEBUG` level.
31+
- A log message emitted when the configured
32+
`high_resolution_telemetry.max_samples_per_minute`
33+
rate limit is violated has been lowered from `WARN`
34+
level to `DEBUG`. This is to avoid repeatedly
35+
logging the same message at a high frequency
36+
when the system is sending more readings than
37+
permitted.
38+
39+
### Fixed
40+
- All deltas calculated based on a current and previous
41+
counter from procfs now take potential overflow into account.
42+
- Fixed a sequencing issue with the cleaning of the MAR directory
43+
concerning an edge case where logs would fail to recover on
44+
devices that are near their disk space or inode quotas.
45+
This would result in stranded log files that would not
46+
get deleted or uploaded to Memfault until there is enough
47+
space to recover them.
48+
949
## [1.16.1] - 2024-01-06
1050

1151
This is a small release that adds coredump capture support for 32-bit ARM
@@ -1182,3 +1222,5 @@ package][nginx-pid-report] for a discussion on the topic.
11821222
https://github.com/memfault/memfault-linux-sdk/releases/tag/1.16.0-kirkstone
11831223
[1.16.1]:
11841224
https://github.com/memfault/memfault-linux-sdk/releases/tag/1.16.1-kirkstone
1225+
[1.17.0]:
1226+
https://github.com/memfault/memfault-linux-sdk/releases/tag/1.17.0-kirkstone

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

VERSION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
BUILD ID: 2781235
2-
GIT COMMIT: ec62db9dc0
3-
VERSION: 1.16.1
1+
BUILD ID: 2808159
2+
GIT COMMIT: 9c4f0059da
3+
VERSION: 1.17.0

memfault-ssf/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "memfault-ssf"
3-
version = "1.16.1"
3+
version = "1.17.0"
44
edition = "2021"
55
description = "Supporting crate for the Memfault memfaultd embedded Linux agent"
66
homepage = "https://github.com/memfault/memfaultd"

memfault-ssf/VERSION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
BUILD ID: 2781235
2-
GIT COMMIT: ec62db9dc0
3-
VERSION: 1.16.1
1+
BUILD ID: 2808159
2+
GIT COMMIT: 9c4f0059da
3+
VERSION: 1.17.0

memfaultc-sys/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "memfaultc-sys"
3-
version = "1.16.1"
3+
version = "1.17.0"
44
edition = "2021"
55
autobins = false
66
description = "Supporting crate for the Memfault memfaultd embedded Linux agent"

memfaultc-sys/VERSION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
BUILD ID: 2781235
2-
GIT COMMIT: ec62db9dc0
3-
VERSION: 1.16.1
1+
BUILD ID: 2808159
2+
GIT COMMIT: 9c4f0059da
3+
VERSION: 1.17.0

memfaultd/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "memfaultd"
3-
version = "1.16.1"
3+
version = "1.17.0"
44
edition = "2021"
55
autobins = false
66
rust-version = "1.72"
@@ -28,8 +28,8 @@ name= "mfw"
2828
path= "src/bin/mfw.rs"
2929

3030
[dependencies]
31-
memfaultc-sys = { path= "../memfaultc-sys", version = "1.16.1" }
32-
ssf = { package = "memfault-ssf", path= "../memfault-ssf", version = "1.16.1" }
31+
memfaultc-sys = { path= "../memfaultc-sys", version = "1.17.0" }
32+
ssf = { package = "memfault-ssf", path= "../memfault-ssf", version = "1.17.0" }
3333
argh = "0.1.10"
3434
cfg-if = "1.0.0"
3535
chrono = { version = "0.4.23", features = ["serde"]}

memfaultd/VERSION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
BUILD ID: 2781235
2-
GIT COMMIT: ec62db9dc0
3-
VERSION: 1.16.1
1+
BUILD ID: 2808159
2+
GIT COMMIT: 9c4f0059da
3+
VERSION: 1.17.0

memfaultd/src/cli/memfaultctl/mod.rs

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
use argh::{FromArgs, TopLevelCommand};
55
use chrono::{DateTime, Utc};
66
use std::{path::Path, str::FromStr, time::Duration};
7+
use write_metrics::write_metrics;
78

89
mod add_battery_reading;
910
mod config_file;
@@ -13,6 +14,7 @@ mod report_sync;
1314
mod session;
1415
mod sync;
1516
mod write_attributes;
17+
mod write_metrics;
1618

1719
use crate::{
1820
cli::version::format_version,
@@ -108,6 +110,7 @@ enum MemfaultctlCommand {
108110
StartSession(StartSessionArgs),
109111
EndSession(EndSessionArgs),
110112
AddCustomDataRecording(AddCustomDataRecordingArgs),
113+
WriteMetrics(WriteMetricsArgs),
111114
}
112115

113116
#[derive(FromArgs)]
@@ -188,6 +191,15 @@ struct WriteAttributesArgs {
188191
attributes: Vec<DeviceAttribute>,
189192
}
190193

194+
#[derive(FromArgs)]
195+
/// write metrics(s) to memfaultd
196+
#[argh(subcommand, name = "write-metrics")]
197+
struct WriteMetricsArgs {
198+
/// metrics to write, in the format <VAR1=VAL1 ...>, or in statsd format <name:value|type ...>
199+
#[argh(positional)]
200+
metrics: Vec<KeyedMetricReading>,
201+
}
202+
191203
#[derive(FromArgs)]
192204
/// add a reading to memfaultd's battery metrics in format "[status string]:[0.0-100.0]".
193205
#[argh(subcommand, name = "add-battery-reading")]
@@ -323,10 +335,11 @@ pub fn main() -> Result<()> {
323335
))
324336
} else {
325337
check_data_collection_enabled(&config, "write attributes")?;
326-
MarEntryBuilder::new(&mar_staging_path)?
327-
.set_metadata(Metadata::new_device_attributes(attributes))
328-
.save(&network_config)
329-
.map(|_entry| ())
338+
let metrics = attributes
339+
.into_iter()
340+
.map(KeyedMetricReading::try_from)
341+
.collect::<Result<Vec<KeyedMetricReading>>>()?;
342+
write_metrics(metrics, &config)
330343
}
331344
}
332345
MemfaultctlCommand::AddBatteryReading(AddBatteryReadingArgs { reading_string }) => {
@@ -379,5 +392,10 @@ pub fn main() -> Result<()> {
379392
.save(&network_config)
380393
.map(|_entry| ())
381394
}
395+
MemfaultctlCommand::WriteMetrics(WriteMetricsArgs { metrics }) => {
396+
check_data_collection_enabled(&config, "write metrics")?;
397+
398+
write_metrics(metrics, &config)
399+
}
382400
}
383401
}

0 commit comments

Comments
 (0)