# Grafana alert feature is not working and throwing the error message “The data source does not support alerting queries”

**URL:** <http://discussions.gridprotectionalliance.org/t/grafana-alert-feature-is-not-working-and-throwing-the-error-message-the-data-source-does-not-support-alerting-queries/698>\
**Category:** openHistorian\
**Created:** [June 10, 2020, 1:43am UTC](http://discussions.gridprotectionalliance.org/t/grafana-alert-feature-is-not-working-and-throwing-the-error-message-the-data-source-does-not-support-alerting-queries/698 "2020-06-10T01:43:50Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![logesaustralia](http://discussions.gridprotectionalliance.org/user_avatar/discussions.gridprotectionalliance.org/logesaustralia/32/514_2.png) [@logesaustralia](http://discussions.gridprotectionalliance.org/u/logesaustralia)\
**Post date:** [June 10, 2020, 1:43am UTC](http://discussions.gridprotectionalliance.org/t/grafana-alert-feature-is-not-working-and-throwing-the-error-message-the-data-source-does-not-support-alerting-queries/698/1 "2020-06-10T01:43:50Z")

</div>

Hi

Grafana alert feature is not working and throwing the error message “The data source does not support alerting queries”.

We are using openHistorian 2.6.30.x and Grafana 6.2.5. We can perform all graph related tasks, but alert configuration for a Graph is not working and when testing the rule, we got below error message.

Object  
firing:true  
state:“pending”  
conditionEvals:" = true"  
timeMs:“0.000ms”  
error:“tsdb.HandleRequest() error Could not find executor for data source type: gridprotectionalliance-openhistorian-datasource”

Please provide more details and what needs to be done.  
Also, I tried to reinstall the data source plugin using Grafana-cli and restarted openHistorian service as well as Grafana.

grafana-cli plugins install gridprotectionalliance-openhistorian-datasource  
installing gridprotectionalliance-openhistorian-datasource @ 1.0.2  
from url: [https://grafana.com/api/plugins/gridprotectionalliance-openhistorian-datasource/versions/1.0.2/download](https://grafana.com/api/plugins/gridprotectionalliance-openhistorian-datasource/versions/1.0.2/download)  
into: …/data/plugins

Installed gridprotectionalliance-openhistorian-datasource successfully

Still getting the same error.

Thanks & Regards  
Logu

---

<div class="post-metadata">

**Author:** ![clackner-gpa](http://discussions.gridprotectionalliance.org/user_avatar/discussions.gridprotectionalliance.org/clackner-gpa/32/556_2.png) [@clackner-gpa](http://discussions.gridprotectionalliance.org/u/clackner-gpa)\
**Post date:** [June 10, 2020, 3:22pm UTC](http://discussions.gridprotectionalliance.org/t/grafana-alert-feature-is-not-working-and-throwing-the-error-message-the-data-source-does-not-support-alerting-queries/698/2 "2020-06-10T15:22:52Z")

</div>

Unfortunately the Grafana openHistorian Datasource does not support Grafana Alerts.  
The DataSource does support annotations and it is possible to show alarms set up in the openHistorian as annotations in Grafana.

Because the openHistorian has its own alarm engine there is currently no need for integration with the Grafana Alert Engine.  
In newer versions of the OpenHistorian (2.8.X) there is limited support for displaying openHistorian alarms on the Graph Panel similarly to Grafana Alerts. However this only displays alerts set up in the openHistorian and still ignores any alerts set up in the Grafana Alert Engine.

---

<div class="post-metadata">

**Author:** ![logesaustralia](http://discussions.gridprotectionalliance.org/user_avatar/discussions.gridprotectionalliance.org/logesaustralia/32/514_2.png) [@logesaustralia](http://discussions.gridprotectionalliance.org/u/logesaustralia)\
**Post date:** [June 10, 2020, 10:59pm UTC](http://discussions.gridprotectionalliance.org/t/grafana-alert-feature-is-not-working-and-throwing-the-error-message-the-data-source-does-not-support-alerting-queries/698/3 "2020-06-10T22:59:31Z")

</div>

HI Clackner,  
Thanks for your quick response and understood the issue.  
We would like to setup the alarm using openHistorian Manager and send notification to designated people using email or telegram.  
Is there any provision available in openHistoran?  
Or  
Do we have any other tools/option to handle this kind of requirements?

Also I checked openHistorian database, looks like there is no option to record the alarm status, can you please clarify, where alarm status is currently maintained in openHistorian.

Please clarify.

Regards  
Logu

---

<div class="post-metadata">

**Author:** ![ritchiecarroll](http://discussions.gridprotectionalliance.org/user_avatar/discussions.gridprotectionalliance.org/ritchiecarroll/32/2_2.png) [@ritchiecarroll](http://discussions.gridprotectionalliance.org/u/ritchiecarroll)\
**Post date:** [June 12, 2020, 6:04pm UTC](http://discussions.gridprotectionalliance.org/t/grafana-alert-feature-is-not-working-and-throwing-the-error-message-the-data-source-does-not-support-alerting-queries/698/4 "2020-06-12T18:04:57Z")

</div>

By default alarm status is archived in the local “Statistics” historian.

Option exists to send an e-mail alert upon alarm - see [`DynamicCalculator.EmailNotifier`](https://github.com/GridProtectionAlliance/gsf/blob/master/Source/Libraries/Adapters/DynamicCalculator/EmailNotifier.cs) action adapter.

Thanks,  
Ritchie

---

<div class="post-metadata">

**Author:** ![logesaustralia](http://discussions.gridprotectionalliance.org/user_avatar/discussions.gridprotectionalliance.org/logesaustralia/32/514_2.png) [@logesaustralia](http://discussions.gridprotectionalliance.org/u/logesaustralia)\
**Post date:** [June 15, 2020, 2:37am UTC](http://discussions.gridprotectionalliance.org/t/grafana-alert-feature-is-not-working-and-throwing-the-error-message-the-data-source-does-not-support-alerting-queries/698/5 "2020-06-15T02:37:15Z")

</div>

Hi,

I could not able to find any specific configuration parameters for Alarm email notification or email notification/DynamicCalculator.EmailNotifier in openHistorian.config file. Could you please explain the steps to configure the email notification for Alarm status?

Also, if you have any document related to that, please share.

Thanks & Regards

Logu

---

<div class="post-metadata">

**Author:** ![ritchiecarroll](http://discussions.gridprotectionalliance.org/user_avatar/discussions.gridprotectionalliance.org/ritchiecarroll/32/2_2.png) [@ritchiecarroll](http://discussions.gridprotectionalliance.org/u/ritchiecarroll)\
**Post date:** [June 15, 2020, 1:05pm UTC](http://discussions.gridprotectionalliance.org/t/grafana-alert-feature-is-not-working-and-throwing-the-error-message-the-data-source-does-not-support-alerting-queries/698/6 "2020-06-15T13:05:38Z")

</div>

This is an adapter that is configured with a connection string, there are no config file parameters for this feature.

Open the openHistorian UI Manager (not the web interface) and navigate to `Actions > Manage Custom Actions` then go to the last page of actions, i.e., click the `>>` button on the bottom right of the page. Now click `Add New` button and select `E-Mail Notifier` from the `Type` list.

This will create an e-mail based on a custom boolean expression, for example:

```auto
VariableList={x = PPA:1; y = PPA:2};
ExpressionText=x+y > 0

```

You will also need to set all the e-mail parameters…

Thanks,  
Ritchie

---

<div class="post-metadata">

**Author:** ![ritchiecarroll](http://discussions.gridprotectionalliance.org/user_avatar/discussions.gridprotectionalliance.org/ritchiecarroll/32/2_2.png) [@ritchiecarroll](http://discussions.gridprotectionalliance.org/u/ritchiecarroll)\
**Post date:** [June 15, 2020, 3:00pm UTC](http://discussions.gridprotectionalliance.org/t/grafana-alert-feature-is-not-working-and-throwing-the-error-message-the-data-source-does-not-support-alerting-queries/698/7 "2020-06-15T15:00:47Z")

</div>

Here is another article you might find useful for dynamic expressions like those used in the 'E-Mail Notifier`:  
[https://gridbits.gridprotectionalliance.org/t/how-to-use-adapter-dynamic-calculator/401](https://gridbits.gridprotectionalliance.org/t/how-to-use-adapter-dynamic-calculator/401)

---

<div class="post-metadata">

**Author:** ![logesaustralia](http://discussions.gridprotectionalliance.org/user_avatar/discussions.gridprotectionalliance.org/logesaustralia/32/514_2.png) [@logesaustralia](http://discussions.gridprotectionalliance.org/u/logesaustralia)\
**Post date:** [June 16, 2020, 6:08am UTC](http://discussions.gridprotectionalliance.org/t/grafana-alert-feature-is-not-working-and-throwing-the-error-message-the-data-source-does-not-support-alerting-queries/698/8 "2020-06-16T06:08:01Z")

</div>

Hi Ritchie,

Thanks for your clarification and able to configure the email alert message successfully.

I have some additional queries, please clarify

1. How to use actual variable in email body?

VariableList= {x = PPA:20274};

I need to use variable X in email body

1. How to add current time as part of email body?
2. If I need to send message for each measurement independently, what is the procedure?  
E.g.
3. PPA:20274
4. PPA:20275

If PPA: 20274 \> 0 then I need to send email to different set of receipts (like A, B and C)  
If PPA: 20275 \> 20 then I need to send email to different set of receipts (like P, Q and R)

Can we use single email notification configuration, or do I need to setup independent alarm for each measurement and set separate email notifier?

Please clarify.

Thanks & Regards  
Logu

---

<div class="post-metadata">

**Author:** ![ritchiecarroll](http://discussions.gridprotectionalliance.org/user_avatar/discussions.gridprotectionalliance.org/ritchiecarroll/32/2_2.png) [@ritchiecarroll](http://discussions.gridprotectionalliance.org/u/ritchiecarroll)\
**Post date:** [June 16, 2020, 2:36pm UTC](http://discussions.gridprotectionalliance.org/t/grafana-alert-feature-is-not-working-and-throwing-the-error-message-the-data-source-does-not-support-alerting-queries/698/9 "2020-06-16T14:36:04Z")

</div>

So it didn’t have that feature, but it was super easy to add - so I put that option in the code:

> <https://github.com/GridProtectionAlliance/gsf/commit/2cceefacc608c810a342fbcf1a5bce99a53e89a5>

So now you can have a body like the following:

```plaintext
Body={This is my e-mail text. The value of x is: {x}. The local time is: {LOCALTIME}}; 

```

I would use different adapter instances for different measurements.

FYI - this change will be in next nightly build which happens around midnight or so in the US Eastern time zone. Once built, you can download and install from here:  
[https://gridprotectionalliance.org/NightlyBuilds/openHistorian/Beta/openHistorian.Installs.zip](https://gridprotectionalliance.org/NightlyBuilds/openHistorian/Beta/openHistorian.Installs.zip)

Thanks,  
Ritchie

---

<div class="post-metadata">

**Author:** ![ritchiecarroll](http://discussions.gridprotectionalliance.org/user_avatar/discussions.gridprotectionalliance.org/ritchiecarroll/32/2_2.png) [@ritchiecarroll](http://discussions.gridprotectionalliance.org/u/ritchiecarroll)\
**Post date:** [June 16, 2020, 2:40pm UTC](http://discussions.gridprotectionalliance.org/t/grafana-alert-feature-is-not-working-and-throwing-the-error-message-the-data-source-does-not-support-alerting-queries/698/10 "2020-06-16T14:40:53Z")

</div>

By the way, this supports string formatting like the following:

```nohighlight
Body={This is my e-mail text.
The value of x is: {x:N3}.
The local time is: {LOCALTIME:yyyy-MM-dd HH:mm:ss.fff}}; 

```

---

<div class="post-metadata">

**Author:** ![logesaustralia](http://discussions.gridprotectionalliance.org/user_avatar/discussions.gridprotectionalliance.org/logesaustralia/32/514_2.png) [@logesaustralia](http://discussions.gridprotectionalliance.org/u/logesaustralia)\
**Post date:** [June 17, 2020, 12:06am UTC](http://discussions.gridprotectionalliance.org/t/grafana-alert-feature-is-not-working-and-throwing-the-error-message-the-data-source-does-not-support-alerting-queries/698/11 "2020-06-17T00:06:41Z")

</div>

Hi ritchi,

Thanks for your quick response.

When alarm is raised, email notifier is keep sending lot of emails per minute.

We have configured an alarm and it was raised only 2 times for the past 24 hrs, but we received around 3000 emails.

Am I missing any configuration?

Please clarify

Thanks & Regards  
Logu

---

<div class="post-metadata">

**Author:** ![ritchiecarroll](http://discussions.gridprotectionalliance.org/user_avatar/discussions.gridprotectionalliance.org/ritchiecarroll/32/2_2.png) [@ritchiecarroll](http://discussions.gridprotectionalliance.org/u/ritchiecarroll)\
**Post date:** [June 17, 2020, 12:53pm UTC](http://discussions.gridprotectionalliance.org/t/grafana-alert-feature-is-not-working-and-throwing-the-error-message-the-data-source-does-not-support-alerting-queries/698/12 "2020-06-17T12:53:19Z")

</div>

Are you sure you are alarming off of the alarm measurement? You’ll need to give me some more context, like alarming parameters, frequency of alarm input, e-mail adapter connection string, etc.

---

<div class="post-metadata">

**Author:** ![logesaustralia](http://discussions.gridprotectionalliance.org/user_avatar/discussions.gridprotectionalliance.org/logesaustralia/32/514_2.png) [@logesaustralia](http://discussions.gridprotectionalliance.org/u/logesaustralia)\
**Post date:** [June 18, 2020, 3:55am UTC](http://discussions.gridprotectionalliance.org/t/grafana-alert-feature-is-not-working-and-throwing-the-error-message-the-data-source-does-not-support-alerting-queries/698/13 "2020-06-18T03:55:37Z")

</div>

Hi Ritchie,

Please find all settings,

**Alarm Settings:**

1. • Tag Name: AL-HIGH: ABCX !TP!ABC:FREQ
2. • Operation: Greater than
3. • Alarm point: 50.05
4. • Hysteresis: 5
5. • Severity :HIGH
6. • Load order 0
7. • Enabled : Yes
8. • Create Associated Measurement: Yes  
**Alarm Service connection String**  
• Name: Alarm ! Services  
• Connection String : useAlarmLog=True; FramesPerSecond=30

**Email Notifier connection string**  
From=abc@Test.com.au; SmtpServer=Test; Subject=OpenHistorian Alarm; Body={The value of x is: {x}.}; ToRecipients=abc@Test.com.au; VariableList={x = PPA:20274}; ExpressionText=x \> 50.050; FramesPerSecond=1

Please review it and let us know, where it needs to be corrected?

---

<div class="post-metadata">

**Author:** ![ritchiecarroll](http://discussions.gridprotectionalliance.org/user_avatar/discussions.gridprotectionalliance.org/ritchiecarroll/32/2_2.png) [@ritchiecarroll](http://discussions.gridprotectionalliance.org/u/ritchiecarroll)\
**Post date:** [June 18, 2020, 2:50pm UTC](http://discussions.gridprotectionalliance.org/t/grafana-alert-feature-is-not-working-and-throwing-the-error-message-the-data-source-does-not-support-alerting-queries/698/14 "2020-06-18T14:50:22Z")

</div>

You need to use both the alarm value (for the trigger - set to ‘`x`’) and the include the frequency value (for the e-mail - set to ‘`y`’). You then need to set the e-mail condition trigger to only evaluate when the alarm is triggered, i.e., `ExpressionText=x > 0`.

You will need to process values continuously to pull this off, so frame rate will need to match frequency rate, e.g., 30, and you will need to set `UseLatestVaues` to `false` so that measurements are processed at their native rate.

Also, since the alarm value will arrive rarely and the frequency value will arrive consistently, the alarm value will be substituted with a sentinel value which defaults to `NaN`. We set sentinel value to `-1` instead to produce a cleaner negative answer to the expression condition of `x > 0` which will be evaluated with each received frequency. See updates to connection string below:

**Email Notifier connection string**

```nohighlight
From=abc@Test.com.au; SmtpServer=Test; Subject=OpenHistorian Alarm;
Body={The frequency value (y) is {y:N3}.}; ToRecipients=abc@Test.com.au;
VariableList={x = AL-HIGH:ABCX!TP!ABC:FREQ; y = PPA:20274};
ExpressionText=x > 0; FramesPerSecond=30; LeadTime=5.0; LagTime=5.0;
UseLatestValues=false; SentinelValue=-1.0

```

---

<div class="post-metadata">

**Author:** ![logesaustralia](http://discussions.gridprotectionalliance.org/user_avatar/discussions.gridprotectionalliance.org/logesaustralia/32/514_2.png) [@logesaustralia](http://discussions.gridprotectionalliance.org/u/logesaustralia)\
**Post date:** [June 19, 2020, 2:01am UTC](http://discussions.gridprotectionalliance.org/t/grafana-alert-feature-is-not-working-and-throwing-the-error-message-the-data-source-does-not-support-alerting-queries/698/15 "2020-06-19T02:01:31Z")

</div>

Hi Ritchi,

Thanks for your reply.

I’m using below connection string for email notifier,

From=abc@Test.com.au; SmtpServer=Test; Subject=OpenHistorian Alarm; Body={The value of x is: {x}.}; ToRecipients=abc@Test.com.au; VariableList={x = AL-HIGH:NOJA\_AZURE!EQL!NP!ECROWE:FREQ; y = PPA:20274}; ExpressionText=x \> 0; FramesPerSecond=30; LagTime=5; UseLatestValues=False; SentinelValue=-1.0

But I’m getting below error while specifying the alarm tag as part of expression. I’m using openHistorian 2.6.x. Is there any limitation?

[6/19/2020 11:56:28 AM] [Action Adapter Collection] Failed to initialize adapter ALERT\_EMAIL\_NOTIFIER: The value is not in the correct format for a MeasurementKey value

[6/19/2020 11:56:28 AM] (Inner Exception)  
Date and Time: 6/19/2020 11:56:28 AM  
Machine Name: NOJA-180  
Machine IP: fe80::341b:7fcc:e46d:cc2c%12  
Machine OS: Microsoft Windows NT 6.2.9200.0

Application Domain: openHistorian.exe  
Assembly Codebase: C:/Program Files/openHistorian/openHistorian.exe  
Assembly Full Name: openHistorian, Version=2.6.30.2, Culture=neutral, PublicKeyToken=null  
Assembly Version: 2.6.30.2  
Assembly Build Date: 3/31/2020 5:29:18 PM  
.Net Runtime Version: 4.0.30319.42000

Exception Source: GSF.TimeSeries  
Exception Type: System.FormatException  
Exception Message: The value is not in the correct format for a MeasurementKey value  
Exception Target Site: Parse

---- Stack Trace ----  
GSF.TimeSeries.MeasurementKey.Parse(value As String)  
openHistorian.exe: N 00094  
DynamicCalculator.DynamicCalculator.GetKey(token As String)  
openHistorian.exe: N 00048  
DynamicCalculator.DynamicCalculator.AddAliasedVariable(token As String)  
openHistorian.exe: N 00108  
DynamicCalculator.DynamicCalculator.set\_VariableList(value As String)  
openHistorian.exe: N 00280  
DynamicCalculator.DynamicCalculator.Initialize()  
openHistorian.exe: N 00151  
DynamicCalculator.EmailNotifier.Initialize()  
openHistorian.exe: N 00378  
GSF.TimeSeries.Adapters.AdapterCollectionBase`1.Initialize(item As T)  
openHistorian.exe: N 00359

---

<div class="post-metadata">

**Author:** ![StephenCWills](http://discussions.gridprotectionalliance.org/user_avatar/discussions.gridprotectionalliance.org/stephencwills/32/20_2.png) [@StephenCWills](http://discussions.gridprotectionalliance.org/u/StephenCWills)\
**Post date:** [June 19, 2020, 2:34am UTC](http://discussions.gridprotectionalliance.org/t/grafana-alert-feature-is-not-working-and-throwing-the-error-message-the-data-source-does-not-support-alerting-queries/698/16 "2020-06-19T02:34:00Z")

</div>

You can’t use the point tag for variables. You’ll need to use the measurement key of that alarm measurement. You can find it on the `Manage Measurements` page in the ID column. It has the format `STAT:###`.

---

<div class="post-metadata">

**Author:** ![logesaustralia](http://discussions.gridprotectionalliance.org/user_avatar/discussions.gridprotectionalliance.org/logesaustralia/32/514_2.png) [@logesaustralia](http://discussions.gridprotectionalliance.org/u/logesaustralia)\
**Post date:** [June 19, 2020, 2:53am UTC](http://discussions.gridprotectionalliance.org/t/grafana-alert-feature-is-not-working-and-throwing-the-error-message-the-data-source-does-not-support-alerting-queries/698/17 "2020-06-19T02:53:00Z")

</div>

Hi Stephen,

Earlier I used VariableList={x = PPA:20274};, but it was keep sending the email, more than 1500 per events.

Ritchi suggested to use  
VariableList={x = AL-HIGH:ABCX!TP!ABC:FREQ; y = PPA:20274};  
But I’m getting initialization error.

Is there any problem with openHistorian 2.6.x?

---

<div class="post-metadata">

**Author:** ![StephenCWills](http://discussions.gridprotectionalliance.org/user_avatar/discussions.gridprotectionalliance.org/stephencwills/32/20_2.png) [@StephenCWills](http://discussions.gridprotectionalliance.org/u/StephenCWills)\
**Post date:** [June 19, 2020, 2:56am UTC](http://discussions.gridprotectionalliance.org/t/grafana-alert-feature-is-not-working-and-throwing-the-error-message-the-data-source-does-not-support-alerting-queries/698/18 "2020-06-19T02:56:44Z")

</div>

No, the problem is `x = AL-HIGH:ABCX!TP!ABC:FREQ`. You need to go to the `Manage Measurements` page, search for that measurement, record what’s in the ID column, and then use that in your variable list instead.

---

<div class="post-metadata">

**Author:** ![logesaustralia](http://discussions.gridprotectionalliance.org/user_avatar/discussions.gridprotectionalliance.org/logesaustralia/32/514_2.png) [@logesaustralia](http://discussions.gridprotectionalliance.org/u/logesaustralia)\
**Post date:** [June 19, 2020, 3:04am UTC](http://discussions.gridprotectionalliance.org/t/grafana-alert-feature-is-not-working-and-throwing-the-error-message-the-data-source-does-not-support-alerting-queries/698/19 "2020-06-19T03:04:49Z")

</div>

Hi Stephen,

 ![image](http://discussions.gridprotectionalliance.org/uploads/default/original/1X/dd42aabe42c034349669104e7f4d8757eaed218e.png)  
Here PPA11:20274 is the key.  
Please tell me, how should I write?  
VariableList={x = AL-HIGH:NOJA\_AZURE!EQL!NP!ECROWE:FREQ; y = PPA:20274};

Logu

---

<div class="post-metadata">

**Author:** ![StephenCWills](http://discussions.gridprotectionalliance.org/user_avatar/discussions.gridprotectionalliance.org/stephencwills/32/20_2.png) [@StephenCWills](http://discussions.gridprotectionalliance.org/u/StephenCWills)\
**Post date:** [June 19, 2020, 3:08am UTC](http://discussions.gridprotectionalliance.org/t/grafana-alert-feature-is-not-working-and-throwing-the-error-message-the-data-source-does-not-support-alerting-queries/698/20 "2020-06-19T03:08:32Z")

</div>

Looks to me like it should be `VariableList={ x=STAT:20371; y=PPA:20274 }`.

[Next page](http://discussions.gridprotectionalliance.org/t/grafana-alert-feature-is-not-working-and-throwing-the-error-message-the-data-source-does-not-support-alerting-queries/698.md?page=2)
