Add mechanism to fetch tags associated with metric/component data #207
Labels
part:❓
We need to figure out which part is affected
priority:❓
We need to figure out how soon this should be addressed
type:enhancement
New feature or enhancement visitble to users
Milestone
What's needed?
We need a mechanism to fetch tags associated with metric/component data while reading from our APIs. Such tags are represented by arbitrary payloads (JSONs) that have a one-to-one relation with sample timestamp.
This could be used to indicate the last activity or last command that was issued to an API, e.g., a charge command to the Dispatch API or Microgrid API. (such tags could be set on these APIs through their own RPCs).
As of now, the tag is intended to be present in only one outgoing data sample, and not in the succesive data samples.
Proposed solution
Solution 1
One way of doing this would be to add a
tag
field in theMetricSample
message. This field would store a JSON to be able to represent arbotrary payloads:(also, suggesting
tag
as the field name because "payload" would generally refer to the whole message, so could be confusing in this context)This would also affect the contents
ComponentData
message. If this solution is accepted, then the message would look like the following:One downside of this solution is that we replicate the tag multiple times for each metric, given the way we have organize the data structure.
Solution 2
Similar to solution1, but structured a bit differently:
This would need a protobuf message:
Use cases
In addition to the broader use-case of tagging inverter activity, there are some cases where the AC electricity data is not enough to identify what's going on. E.g., in case of the FCR app, this could help determine working-point-offset (assuming the app uses it properly). In this example, obtaining the working-point-offset just from AC data would be difficult, if not impossible.
Alternatives and workarounds
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: