grafana / iot-sitewise-datasource

IoT Sitewise
Apache License 2.0
19 stars 9 forks source link

Feature request: Support for Asset Model component properties #269

Closed mikejwil closed 4 months ago

mikejwil commented 6 months ago

Is your feature request related to a problem? Please describe. AWS IoT SiteWise now supports Asset model components to help industrial customers create reusable components to derive new asset models and express variations easily. For example, a wind turbine is made of many smaller components such as blades, rotors, and generators. More info: https://aws.amazon.com/about-aws/whats-new/2023/11/aws-iot-sitewise-supports-asset-model-components/

Problem: Today, Grafana's iot-sitewise-datasource only allows for charting properties at the root of an asset, which means the properties within a component is not available for charting.

Describe the solution you'd like Users should be able to select the properties grouped within a component. To do so, the datasource should:

  1. Instead of using DescribeAsset when retrieving the list of properties on an Asset, instead use ListAssetProperties API with query parameter filter set to "ALL".
  2. Use the path in the AssetPropertySummaries response object to showcase how properties are part of various components under the same asset (ex. Motor1 / AvgTorque indicates the property is part of the Motor1 component versus Torque which a property defined at the root of the asset).

Additional context Composite Models is used in the SiteWise API to define Components. Therefore, the properties returned in step 1 will show the assetCompositeModelId it is part of, which is equivalent to a "component" in this context.

tracy-french commented 6 months ago

@mikejwil Hi! I will take this issue!

mikejwil commented 6 months ago

Great! Thanks @tracy-french.

seb-koch commented 5 months ago

Hi @tracy-french , does the envisioned solution allow creating a variable that shows a list of all properties for a certain Assett?

I am trying to understand if this is the right Issue here or if I should dig deeper or create a new issue for what we're trying to do.

Our use case: A dashboard with two variables. One for the assett and one for the property. Our customers would select the assett (i.e. a Site) and a property (i.e. Humidity Reading Sensor 1).

tracy-french commented 4 months ago

Hey @seb-koch! The plan is to utilize ListAssetProperties/ListAssetModelProperties to populate the drop-down list of asset properties. Currently, it is using DescribeAsset, which does not contain the component properties.

There has been no consideration to create a variable containing the list of asset properties as part of this feature. A different change would be required to enable the utilization of a variable containing asset properties.

We can consider prioritizing this feature if you could please create a feature request issue describing your ask.

sarahzinger commented 4 months ago

This was released in https://github.com/grafana/iot-sitewise-datasource/releases/tag/v1.17.0