Skip to content

Commit 4b476d7

Browse files
Merge pull request #45 from stefan-brus-frequenz/sources
Add metric source options message
2 parents 5e033bd + 8ecdba2 commit 4b476d7

2 files changed

Lines changed: 24 additions & 2 deletions

File tree

RELEASE_NOTES.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@
22

33
## Summary
44

5-
- Add time filter options to the streaming request, to allow for streaming of historical data.
5+
- Metric source options
66

77
## Upgrading
88

99
<!-- Here goes notes on how to upgrade from previous versions, including deprecations and what they should be replaced with -->
1010

1111
## New Features
1212

13-
- The streaming requests now contain optional `TimeFilter` objects for streaming historical data.
13+
- A new field, `MetricSourceOptions` has been added to the `StreamFilter` message, allowing users to give specific sources for a given metric.
14+
Multiples of the same metric can exist, in which case they are "tagged" with the source they come from. The metric source options allows
15+
the user to specify one or multiple tags.
1416

1517
## Bug Fixes
1618

proto/frequenz/api/reporting/v1/reporting.proto

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,18 @@ message SimpleAggregatedMetricValue {
182182
frequenz.api.common.v1.metrics.SimpleMetricValue sample = 2;
183183
}
184184

185+
// Filter for sources for metrics, specified for a single metric at a time.
186+
// Specifying a metric here will only stream data for that metric where data
187+
// can be found tagged with the given source names.
188+
message MetricSourceOptions {
189+
// The metric for which sources will be filtered.
190+
frequenz.api.common.v1.metrics.Metric metric = 1;
191+
192+
// A list of sources to allow for the specified metric.
193+
// If this list is empty, then no data for this metric is streamed.
194+
repeated string metric_sources = 2;
195+
}
196+
185197
// Message defining the request format for fetching historical metrics, such as electrical
186198
// measurements, and other information for individual microgrid components.
187199
//
@@ -312,6 +324,14 @@ message ReceiveMicrogridComponentsDataStreamRequest {
312324
// Optional time-based filter criteria.
313325
// If omitted, data will start streaming from the timestamp that the request was received.
314326
TimeFilter time_filter = 3;
327+
328+
// List of metric source filters
329+
// For the metrics present in this list, the data from only the specified
330+
// sources will be returned. If no sources are provided for a metric in this
331+
// list, then no data will be returned for the said metric.
332+
// For the metrics not present in this list, data from all of their sources will
333+
// be returned.
334+
repeated MetricSourceOptions metric_sources = 4;
315335
}
316336

317337
// Encapsulates the microgrid ID and the component IDs within that microgrid for which

0 commit comments

Comments
 (0)