Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic Alarm Config Panel #84

Merged
merged 3 commits into from
Aug 1, 2022
Merged

Conversation

haweston
Copy link
Collaborator

@haweston haweston commented Jul 27, 2022

This adds a new visualization type to the selection when making a panel: AWS IoT TwinMaker Alarm Configuration

To configure this panel you'll need to set it's custom panel config option of Workspace to the workspace you want to pull from in your Grafana TwinMaker Datasource.

For the query select your desired TwinMaker Datasource, add a query, use Get Property Value History by Entity along with the Entity and Component (or template variables for those) that you want. The panel expect the component type to support and query properties of: alarm_status, alarm_threshold, and alarm_notification_recipients. These are support in our beta pre-defined component type: com.amazon.iotsitewise.alarm that isn't publically available yet.

Once configured the panel should display the alarm Id base on the Component Name, Threshold based on the alarm_threshold, and Notification based on alarm_notification-recipients. If testing with AWS IoT Sitewise alarms the values for threshold and notifications are often not updated regularly so a longer query time range may be necessary to generate data. If you get a warning of: missing data then this probably means you need to get data into your time range.

The panel's Edit Alarm button allows you to open a modal that sets a new threshold for you alarm via TwinMakers BatchPutPropertyValues API. The new threshold should update in the Alarm Config Panel, your original datasource, and any Grafana charts you have displaying it's current value.

The TwinMaker workspace role will need the additional permissions in it's policy:

       {
       "Effect": "Allow",
            "Action": [
                "iotevents:DescribeAlarmModel"
            ],
            "Resource": "*"
        },
        {
            "Effect": "Allow",
            "Action": [
                "iotsitewise:BatchPutAssetPropertyValue"
            ],
            "Resource": "*"
        }

The TwinMaker Dashboard role used with your Grafana Datasource will need the additional permissions in it's policy:

{
            "Effect": "Allow",
            "Action": [
                "iottwinmaker:BatchPutPropertyValues"
            ],
            "Resource": [
                "<workspace arn>",
                "<workspace arn>/*"
            ]
        }

@CLAassistant
Copy link

CLAassistant commented Jul 27, 2022

CLA assistant check
All committers have signed the CLA.

@haweston haweston merged commit 9d06639 into alarmConfigurationFeature Aug 1, 2022
@fridgepoet fridgepoet deleted the alarmConfigPanel branch January 31, 2023 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants