DewesoftX offers event functionality that allows you to set trigger points or conditions that activate events. A predefined example is the “Storing” event, which automatically triggers whenever file storage starts or stops (custom triggers can also be created). These events can then be imported into Grafana and displayed as annotations.
To test Grafana event annotations, we will begin by configuring DewesoftX. Since the "Storing" event is predefined, we will use that as an example.
First, open DewesoftX and navigate to the Historian Client Publisher. Locate the Data_event channel and activate it by toggling the button in the "Used" column to "Publish."
Now switch to Subscriber section, find your Data events channel and remember the name of this channel for later:
Now, go to Channel Setup and open the Storing section. Configure the storing functionality to create files sequentially by checking the “Create a Multifile” option and selecting "Make new file after" checkbox. Enter the desired file saving interval in seconds (10 seconds or higher recommended), and ensure "sec" is selected as the unit from the dropdown menu.
Once DewesoftX file storage is configured, click 'Store' to begin the measurement process with file storage. DewesoftX will enter measurement mode, and if the storage configuration is correct, a red annotation will appear on the graph at every defined interval, indicating the occurrence of a new storage event.
Additionally, your events will be displayed in the Event Viewer, which is located in the top right corner of the interface.
With your Data_event channel activated, storage properly configured, and DewesoftX running in measurement mode, switch to Grafana in your web browser. Find your Dashboard and open dashboard settings:
Go to the Annotations section and click "Add annotation query" to configure a new query that fetches and displays event data, such as the "Storing" events from DewesoftX.
To properly configure annotations in Grafana using data from InfluxDB and events from DewesoftX, follow these steps:
- Assign annotation name:
- Assign a descriptive annotation name that makes it easy to identify the specific event or data type being tracked.
- Ensure the correct data source:
- Configure the data source to pull from InfluxDB instead of Grafana itself.
- Enable annotation auto-refresh:
- Check the "Enabled" option to ensure that annotations are refreshed automatically with every dashboard refresh.
With the name of the Data_event publisher channel, which was activated earlier in DewesoftX, and the event name, such as "Storing" construct the following query:
select value from <Data_events publisher channel name> where value =~ /<event name>/ and $timeFilter limit 1000
If your Dewesoft measurement was running and you observed the "Storing" events occurring alongside the activated Data_events channel, those events have been saved in the database.
To verify if your events were successfully stored, click the "Test annotation query" button. If the query returns or finds your "Storing" events, you're ready to proceed. Apply the changes, save the dashboard, and return to the corresponding graph.
A switch should appear at the top of your graph, labeled with the name of your annotation. Ensure that the time range of your graph matches the period when the "Storing" event occurred. Finally, turn the switch on to display your annotations on the graph in the color you specified during setup.