grafana / timestream-datasource

Amazon Timestream in Grafana
https://grafana.com/grafana/plugins/grafana-timestream-datasource
Apache License 2.0
24 stars 19 forks source link

Timestream as an Alerting Datasource #17

Closed dt-atkinson closed 3 years ago

dt-atkinson commented 3 years ago

Currently I get an error when I try to use timestream for alerting. The alerting page does not list timestream as supported.

Is this going to be added?

Error: tsdb.HandleRequest() error Could not find executor for data source type: grafana-timestream-datasource

ryantxu commented 3 years ago

What query are you using? And what does the result look like?

Alerting should work for queries that return time and numeric values.

Can you post the output from 'test alert'?

dt-atkinson commented 3 years ago

Ah okay, so it should work?

I am doing a reasonably complex query which creates a timeseries. I will try a super simple one and get back to you.

dt-atkinson commented 3 years ago

Example Query:

SELECT host, node, CREATE_TIME_SERIES(time, measure_value::bigint) AS $__measure
FROM $__database.$__table
WHERE $__timeFilter AND measure_name = '$__measure'
GROUP BY host, node

Test output:

This is big. Click me ``` { "firing": true, "state": "pending", "conditionEvals": "true = true", "timeMs": "-780.126ms", "matches": [ { "metric": "fd_used {host=ip-172-28-102-50.test.aws, node=rabbit@ip-172-28-122-17}", "value": 105.27586206896552 }, { "metric": "fd_used {host=ip-172-28-103-100.test.aws, node=rabbit@ip-172-28-122-17}", "value": 105.3 }, { "metric": "fd_used {host=ip-172-28-103-100.test.aws, node=rabbit@ip-172-28-121-149}", "value": 122.43333333333334 }, { "metric": "fd_used {host=ip-172-28-102-50.test.aws, node=rabbit@ip-172-28-121-149}", "value": 122.43333333333334 } ], "logs": [ { "message": "Condition[0]: Query", "data": { "from": 1605265065984, "queries": [ { "refId": "A", "model": { "measure": "fd_used", "queryType": "raw", "rawQuery": "SELECT host, node, CREATE_TIME_SERIES(time, measure_value::bigint) AS $__measure\nFROM $__database.$__table\nWHERE $__timeFilter AND measure_name = '$__measure'\nGROUP BY host, node", "refId": "A", "table": "rabbitmq_node" }, "datasource": { "id": 5, "name": "Amazon Timestream Test" }, "maxDataPoints": 0, "intervalMs": 0 } ], "to": 1605265365984 } }, { "message": "Condition[0]: Query Result", "data": { "fromDataframe": true, "series": [ { "name": "fd_used {host=ip-172-28-102-50.test.aws, node=rabbit@ip-172-28-123-53}", "points": [ [ 77, 1605265070000 ], [ 77, 1605265080000 ], [ 76, 1605265091000 ], [ 76, 1605265100000 ], [ 77, 1605265110000 ], [ 74, 1605265120000 ], [ 77, 1605265130000 ], [ 77, 1605265141000 ], [ 77, 1605265150000 ], [ 77, 1605265161000 ], [ 78, 1605265171000 ], [ 77, 1605265180000 ], [ 76, 1605265190000 ], [ 76, 1605265201000 ], [ 76, 1605265210000 ], [ 74, 1605265220000 ], [ 75, 1605265230000 ], [ 77, 1605265240000 ], [ 74, 1605265250000 ], [ 76, 1605265260000 ], [ 76, 1605265270000 ], [ 74, 1605265281000 ], [ 77, 1605265291000 ], [ 76, 1605265301000 ], [ 76, 1605265311000 ], [ 74, 1605265320000 ], [ 74, 1605265330000 ], [ 76, 1605265340000 ], [ 77, 1605265351000 ] ], "tags": { "host": "ip-172-28-102-50.test.aws", "node": "rabbit@ip-172-28-123-53" } }, { "name": "fd_used {host=ip-172-28-102-50.test.aws, node=rabbit@ip-172-28-122-17}", "points": [ [ 107, 1605265071000 ], [ 106, 1605265081000 ], [ 107, 1605265091000 ], [ 109, 1605265101000 ], [ 106, 1605265110000 ], [ 107, 1605265120000 ], [ 107, 1605265130000 ], [ 103, 1605265141000 ], [ 104, 1605265150000 ], [ 107, 1605265162000 ], [ 105, 1605265171000 ], [ 104, 1605265180000 ], [ 105, 1605265191000 ], [ 105, 1605265203000 ], [ 106, 1605265210000 ], [ 104, 1605265221000 ], [ 105, 1605265231000 ], [ 104, 1605265241000 ], [ 106, 1605265251000 ], [ 104, 1605265262000 ], [ 103, 1605265271000 ], [ 104, 1605265281000 ], [ 104, 1605265290000 ], [ 102, 1605265301000 ], [ 105, 1605265311000 ], [ 107, 1605265321000 ], [ 105, 1605265331000 ], [ 106, 1605265340000 ], [ 106, 1605265351000 ] ], "tags": { "host": "ip-172-28-102-50.test.aws", "node": "rabbit@ip-172-28-122-17" } }, { "name": "fd_used {host=ip-172-28-103-100.test.aws, node=rabbit@ip-172-28-123-53}", "points": [ [ 77, 1605265070000 ], [ 77, 1605265080000 ], [ 76, 1605265091000 ], [ 76, 1605265100000 ], [ 77, 1605265110000 ], [ 74, 1605265120000 ], [ 77, 1605265130000 ], [ 77, 1605265141000 ], [ 77, 1605265150000 ], [ 77, 1605265161000 ], [ 78, 1605265171000 ], [ 77, 1605265181000 ], [ 76, 1605265190000 ], [ 76, 1605265201000 ], [ 76, 1605265210000 ], [ 74, 1605265220000 ], [ 75, 1605265231000 ], [ 77, 1605265240000 ], [ 74, 1605265250000 ], [ 76, 1605265261000 ], [ 76, 1605265270000 ], [ 74, 1605265281000 ], [ 77, 1605265291000 ], [ 76, 1605265300000 ], [ 76, 1605265311000 ], [ 74, 1605265320000 ], [ 74, 1605265330000 ], [ 76, 1605265340000 ], [ 77, 1605265350000 ], [ 73, 1605265361000 ] ], "tags": { "host": "ip-172-28-103-100.test.aws", "node": "rabbit@ip-172-28-123-53" } }, { "name": "fd_used {host=ip-172-28-102-50.test.aws, node=rabbit@ip-172-28-123-119}", "points": [ [ 91, 1605265071000 ], [ 91, 1605265081000 ], [ 96, 1605265090000 ], [ 93, 1605265100000 ], [ 91, 1605265110000 ], [ 92, 1605265120000 ], [ 91, 1605265131000 ], [ 92, 1605265141000 ], [ 93, 1605265150000 ], [ 91, 1605265160000 ], [ 91, 1605265170000 ], [ 92, 1605265181000 ], [ 95, 1605265190000 ], [ 93, 1605265201000 ], [ 94, 1605265211000 ], [ 94, 1605265221000 ], [ 92, 1605265231000 ], [ 94, 1605265240000 ], [ 93, 1605265250000 ], [ 94, 1605265260000 ], [ 94, 1605265270000 ], [ 96, 1605265280000 ], [ 95, 1605265290000 ], [ 98, 1605265301000 ], [ 94, 1605265311000 ], [ 95, 1605265320000 ], [ 95, 1605265330000 ], [ 95, 1605265340000 ], [ 95, 1605265350000 ] ], "tags": { "host": "ip-172-28-102-50.test.aws", "node": "rabbit@ip-172-28-123-119" } }, { "name": "fd_used {host=ip-172-28-103-100.test.aws, node=rabbit@ip-172-28-122-17}", "points": [ [ 107, 1605265071000 ], [ 106, 1605265081000 ], [ 107, 1605265090000 ], [ 109, 1605265101000 ], [ 106, 1605265110000 ], [ 107, 1605265120000 ], [ 107, 1605265130000 ], [ 103, 1605265141000 ], [ 104, 1605265150000 ], [ 107, 1605265162000 ], [ 105, 1605265171000 ], [ 104, 1605265181000 ], [ 105, 1605265191000 ], [ 105, 1605265203000 ], [ 106, 1605265210000 ], [ 104, 1605265221000 ], [ 105, 1605265231000 ], [ 104, 1605265241000 ], [ 106, 1605265251000 ], [ 104, 1605265262000 ], [ 103, 1605265271000 ], [ 104, 1605265281000 ], [ 104, 1605265290000 ], [ 102, 1605265300000 ], [ 105, 1605265311000 ], [ 107, 1605265321000 ], [ 105, 1605265331000 ], [ 106, 1605265340000 ], [ 106, 1605265351000 ], [ 106, 1605265361000 ] ], "tags": { "host": "ip-172-28-103-100.test.aws", "node": "rabbit@ip-172-28-122-17" } }, { "name": "fd_used {host=ip-172-28-102-50.test.aws, node=rabbit@ip-172-28-123-225}", "points": [ [ 56, 1605265070000 ], [ 56, 1605265080000 ], [ 56, 1605265090000 ], [ 56, 1605265100000 ], [ 58, 1605265110000 ], [ 58, 1605265120000 ], [ 58, 1605265130000 ], [ 58, 1605265140000 ], [ 58, 1605265150000 ], [ 58, 1605265160000 ], [ 58, 1605265170000 ], [ 58, 1605265180000 ], [ 58, 1605265190000 ], [ 58, 1605265200000 ], [ 56, 1605265210000 ], [ 56, 1605265220000 ], [ 56, 1605265230000 ], [ 56, 1605265240000 ], [ 58, 1605265250000 ], [ 58, 1605265260000 ], [ 56, 1605265270000 ], [ 56, 1605265280000 ], [ 56, 1605265290000 ], [ 58, 1605265300000 ], [ 58, 1605265310000 ], [ 58, 1605265320000 ], [ 58, 1605265330000 ], [ 58, 1605265340000 ], [ 58, 1605265350000 ], [ 58, 1605265360000 ] ], "tags": { "host": "ip-172-28-102-50.test.aws", "node": "rabbit@ip-172-28-123-225" } }, { "name": "fd_used {host=ip-172-28-103-100.test.aws, node=rabbit@ip-172-28-123-119}", "points": [ [ 91, 1605265071000 ], [ 91, 1605265081000 ], [ 96, 1605265090000 ], [ 93, 1605265100000 ], [ 91, 1605265110000 ], [ 92, 1605265120000 ], [ 91, 1605265131000 ], [ 92, 1605265140000 ], [ 93, 1605265150000 ], [ 91, 1605265161000 ], [ 91, 1605265171000 ], [ 92, 1605265181000 ], [ 95, 1605265190000 ], [ 93, 1605265201000 ], [ 94, 1605265211000 ], [ 94, 1605265221000 ], [ 92, 1605265231000 ], [ 94, 1605265240000 ], [ 93, 1605265250000 ], [ 94, 1605265261000 ], [ 94, 1605265270000 ], [ 96, 1605265280000 ], [ 95, 1605265290000 ], [ 98, 1605265301000 ], [ 94, 1605265310000 ], [ 95, 1605265320000 ], [ 95, 1605265330000 ], [ 95, 1605265340000 ], [ 95, 1605265351000 ], [ 95, 1605265360000 ] ], "tags": { "host": "ip-172-28-103-100.test.aws", "node": "rabbit@ip-172-28-123-119" } }, { "name": "fd_used {host=ip-172-28-103-100.test.aws, node=rabbit@ip-172-28-123-225}", "points": [ [ 56, 1605265070000 ], [ 56, 1605265080000 ], [ 56, 1605265090000 ], [ 56, 1605265100000 ], [ 58, 1605265110000 ], [ 58, 1605265120000 ], [ 58, 1605265130000 ], [ 58, 1605265140000 ], [ 58, 1605265150000 ], [ 58, 1605265160000 ], [ 58, 1605265170000 ], [ 58, 1605265180000 ], [ 58, 1605265190000 ], [ 58, 1605265200000 ], [ 56, 1605265210000 ], [ 56, 1605265220000 ], [ 56, 1605265230000 ], [ 56, 1605265240000 ], [ 58, 1605265250000 ], [ 58, 1605265260000 ], [ 56, 1605265270000 ], [ 56, 1605265280000 ], [ 56, 1605265290000 ], [ 58, 1605265300000 ], [ 58, 1605265310000 ], [ 58, 1605265320000 ], [ 58, 1605265330000 ], [ 58, 1605265340000 ], [ 58, 1605265350000 ], [ 58, 1605265360000 ] ], "tags": { "host": "ip-172-28-103-100.test.aws", "node": "rabbit@ip-172-28-123-225" } }, { "name": "fd_used {host=ip-172-28-102-50.test.aws, node=rabbit@ip-172-28-121-58}", "points": [ [ 56, 1605265070000 ], [ 55, 1605265080000 ], [ 55, 1605265090000 ], [ 55, 1605265100000 ], [ 55, 1605265110000 ], [ 55, 1605265120000 ], [ 56, 1605265130000 ], [ 55, 1605265140000 ], [ 55, 1605265150000 ], [ 55, 1605265160000 ], [ 55, 1605265170000 ], [ 55, 1605265180000 ], [ 56, 1605265190000 ], [ 55, 1605265200000 ], [ 55, 1605265210000 ], [ 55, 1605265220000 ], [ 55, 1605265230000 ], [ 55, 1605265240000 ], [ 56, 1605265250000 ], [ 55, 1605265260000 ], [ 55, 1605265270000 ], [ 55, 1605265280000 ], [ 55, 1605265290000 ], [ 57, 1605265300000 ], [ 56, 1605265310000 ], [ 55, 1605265320000 ], [ 55, 1605265330000 ], [ 55, 1605265340000 ], [ 55, 1605265350000 ], [ 55, 1605265360000 ] ], "tags": { "host": "ip-172-28-102-50.test.aws", "node": "rabbit@ip-172-28-121-58" } }, { "name": "fd_used {host=ip-172-28-103-100.test.aws, node=rabbit@ip-172-28-121-58}", "points": [ [ 56, 1605265070000 ], [ 55, 1605265080000 ], [ 55, 1605265090000 ], [ 55, 1605265100000 ], [ 55, 1605265110000 ], [ 55, 1605265120000 ], [ 56, 1605265130000 ], [ 55, 1605265140000 ], [ 55, 1605265150000 ], [ 55, 1605265160000 ], [ 55, 1605265170000 ], [ 55, 1605265180000 ], [ 56, 1605265190000 ], [ 55, 1605265200000 ], [ 55, 1605265210000 ], [ 55, 1605265220000 ], [ 55, 1605265230000 ], [ 55, 1605265240000 ], [ 56, 1605265250000 ], [ 55, 1605265260000 ], [ 55, 1605265270000 ], [ 55, 1605265280000 ], [ 55, 1605265290000 ], [ 57, 1605265300000 ], [ 56, 1605265310000 ], [ 55, 1605265320000 ], [ 55, 1605265330000 ], [ 55, 1605265340000 ], [ 55, 1605265350000 ], [ 55, 1605265360000 ] ], "tags": { "host": "ip-172-28-103-100.test.aws", "node": "rabbit@ip-172-28-121-58" } }, { "name": "fd_used {host=ip-172-28-103-100.test.aws, node=rabbit@ip-172-28-121-149}", "points": [ [ 124, 1605265070000 ], [ 122, 1605265080000 ], [ 123, 1605265091000 ], [ 123, 1605265100000 ], [ 123, 1605265111000 ], [ 123, 1605265121000 ], [ 124, 1605265130000 ], [ 124, 1605265141000 ], [ 123, 1605265151000 ], [ 123, 1605265161000 ], [ 123, 1605265171000 ], [ 122, 1605265181000 ], [ 124, 1605265190000 ], [ 124, 1605265201000 ], [ 124, 1605265211000 ], [ 124, 1605265220000 ], [ 124, 1605265230000 ], [ 123, 1605265241000 ], [ 122, 1605265251000 ], [ 122, 1605265261000 ], [ 122, 1605265270000 ], [ 122, 1605265281000 ], [ 122, 1605265291000 ], [ 122, 1605265301000 ], [ 120, 1605265311000 ], [ 120, 1605265321000 ], [ 120, 1605265331000 ], [ 120, 1605265341000 ], [ 120, 1605265351000 ], [ 121, 1605265360000 ] ], "tags": { "host": "ip-172-28-103-100.test.aws", "node": "rabbit@ip-172-28-121-149" } }, { "name": "fd_used {host=ip-172-28-102-50.test.aws, node=rabbit@ip-172-28-121-149}", "points": [ [ 124, 1605265070000 ], [ 122, 1605265080000 ], [ 123, 1605265091000 ], [ 123, 1605265100000 ], [ 123, 1605265111000 ], [ 123, 1605265121000 ], [ 124, 1605265130000 ], [ 124, 1605265141000 ], [ 123, 1605265151000 ], [ 123, 1605265161000 ], [ 123, 1605265170000 ], [ 122, 1605265181000 ], [ 124, 1605265190000 ], [ 124, 1605265201000 ], [ 124, 1605265211000 ], [ 124, 1605265220000 ], [ 124, 1605265230000 ], [ 123, 1605265241000 ], [ 122, 1605265251000 ], [ 122, 1605265260000 ], [ 122, 1605265270000 ], [ 122, 1605265281000 ], [ 122, 1605265291000 ], [ 122, 1605265301000 ], [ 120, 1605265311000 ], [ 120, 1605265321000 ], [ 120, 1605265331000 ], [ 120, 1605265341000 ], [ 120, 1605265351000 ], [ 121, 1605265360000 ] ], "tags": { "host": "ip-172-28-102-50.test.aws", "node": "rabbit@ip-172-28-121-149" } } ] } }, { "message": "Condition[0]: Eval: false, Metric: fd_used {host=ip-172-28-102-50.test.aws, node=rabbit@ip-172-28-123-53}, Value: 76.000", "data": null }, { "message": "Condition[0]: Eval: true, Metric: fd_used {host=ip-172-28-102-50.test.aws, node=rabbit@ip-172-28-122-17}, Value: 105.276", "data": null }, { "message": "Condition[0]: Eval: false, Metric: fd_used {host=ip-172-28-103-100.test.aws, node=rabbit@ip-172-28-123-53}, Value: 75.900", "data": null }, { "message": "Condition[0]: Eval: false, Metric: fd_used {host=ip-172-28-102-50.test.aws, node=rabbit@ip-172-28-123-119}, Value: 93.448", "data": null }, { "message": "Condition[0]: Eval: true, Metric: fd_used {host=ip-172-28-103-100.test.aws, node=rabbit@ip-172-28-122-17}, Value: 105.300", "data": null }, { "message": "Condition[0]: Eval: false, Metric: fd_used {host=ip-172-28-102-50.test.aws, node=rabbit@ip-172-28-123-225}, Value: 57.267", "data": null }, { "message": "Condition[0]: Eval: false, Metric: fd_used {host=ip-172-28-103-100.test.aws, node=rabbit@ip-172-28-123-119}, Value: 93.500", "data": null }, { "message": "Condition[0]: Eval: false, Metric: fd_used {host=ip-172-28-103-100.test.aws, node=rabbit@ip-172-28-123-225}, Value: 57.267", "data": null }, { "message": "Condition[0]: Eval: false, Metric: fd_used {host=ip-172-28-102-50.test.aws, node=rabbit@ip-172-28-121-58}, Value: 55.233", "data": null }, { "message": "Condition[0]: Eval: false, Metric: fd_used {host=ip-172-28-103-100.test.aws, node=rabbit@ip-172-28-121-58}, Value: 55.233", "data": null }, { "message": "Condition[0]: Eval: true, Metric: fd_used {host=ip-172-28-103-100.test.aws, node=rabbit@ip-172-28-121-149}, Value: 122.433", "data": null }, { "message": "Condition[0]: Eval: true, Metric: fd_used {host=ip-172-28-102-50.test.aws, node=rabbit@ip-172-28-121-149}, Value: 122.433", "data": null } ] } ```

Actual Error (from scheduler in state history):

PENDING
Error: tsdb.HandleRequest() error Could not find executor for data source type: grafana-timestream-datasource
dt-atkinson commented 3 years ago

Closing this due to invalidity. We have another box without the plugin installed picking up the scheduled alerts for run.