Skip to content

Commit 2a0ca00

Browse files
Remove SensorMetricSample in favour of MetricSample
This commit removes the `SensorMetricSample` message in favour of using `MetricSample` for sensors. The `SensorMetricSample` message was a subset of the `MetricSample` message. From a design perspective focused on consistency, flexibility, and minimizing API surface area while handling variations via optional fields (which is idiomatic in Protobuf3), there's a strong argument that `SensorMetricSample` is redundant and potentially confusing, and that having only `MetricSample` is a cleaner design. Signed-off-by: Tiyash Basu <[email protected]>
1 parent d863621 commit 2a0ca00

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

RELEASE_NOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
- Renamed `SensorState` to `SensorStateSnapshot` to better reflect its purpose.
3636
- Renamed `sampled_at` timestamps for state snapshots to `origin_time`.
3737
- Renamed `sampled_at` timestamps for metric samples to `sample_time`.
38+
- Remove `SensorMetricSample` in favour of using `MetricSample` for sensors.
3839

3940
## Bug Fixes
4041

proto/frequenz/api/common/v1/microgrid/sensors/sensors.proto

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,11 +233,15 @@ message SensorMetricSample {
233233
// sample_time: "2023-10-01T00:00:00Z",
234234
// metric: "METRIC_SENSOR_TEMPERATURE",
235235
// value: metric_value_variant: {simple_metric: {value: 23.5},
236+
// bounds: {}
237+
// source: {}
236238
// },
237239
// {
238240
// sample_time: "2023-10-01T00:00:00Z",
239241
// metric: "METRIC_SENSOR_RELATIVE_HUMIDITY",
240242
// value: metric_value_variant: {simple_metric: {value: 23.5},
243+
// bounds: {}
244+
// source: "humidity_sensor_1"
241245
// }
242246
// ],
243247
// states: [
@@ -254,7 +258,7 @@ message SensorData {
254258
uint64 sensor_id = 1;
255259

256260
// List of measurements for a metric of the specific microgrid sensor.
257-
repeated SensorMetricSample metric_samples = 2;
261+
repeated frequenz.api.common.v1.metrics.MetricSample metric_samples = 2;
258262

259263
// List of states of a specific microgrid sensor.
260264
repeated SensorStateSnapshot states = 3;

0 commit comments

Comments
 (0)