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

Add Alert support #34

Closed
jusech5 opened this issue Apr 2, 2019 · 23 comments
Closed

Add Alert support #34

jusech5 opened this issue Apr 2, 2019 · 23 comments
Labels
backlog Would like it to be implemented enhancement New feature or request help wanted Extra attention is needed stale wontfix This will not be worked on

Comments

@jusech5
Copy link

jusech5 commented Apr 2, 2019

The only way to know this is to try and be disappointed.

Thanks

@simPod
Copy link
Owner

simPod commented Apr 2, 2019

I suppose it can be implemented after this is done grafana/grafana#16026 and also mabye this grafana/grafana#6841

PR is welcome!

@simPod simPod changed the title Put in documentation that alert is not supported Add Alert support Apr 2, 2019
@simPod simPod added enhancement New feature or request help wanted Extra attention is needed labels Apr 2, 2019
@tomisaacson
Copy link

Seems to be some movement in grafana/grafana#16631:

I'm assuming that this plugin will need to migrate to a backend plugin, or at least partly?

@andig
Copy link
Collaborator

andig commented Apr 23, 2019

I'm assuming that this plugin will need to migrate to a backend plugin, or at least partly?

Yes- we would need to execute at least the query part through the backend. The main point initially would be to check

  • how we can pass additional data as part of the /query request (i.e. can we modify the request data model?)
  • how to access and interpolate variables- is that still task of the frontend or does this move into the backend query logic?

Cloned https://github.com/grafana/simple-json-backend-datasource/ from simple-json-datasource and started modifying.

Would be happy to accept a PR. I can probably help some with go part if needed.

@stale
Copy link

stale bot commented Jul 11, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Jul 11, 2019
@simPod simPod pinned this issue Jul 11, 2019
@stale stale bot removed the wontfix This will not be worked on label Jul 11, 2019
@simPod simPod added the pinned label Jul 11, 2019
@natenho
Copy link

natenho commented Aug 13, 2019

I've tried to reach the guy from https://github.com/grafana/simple-json-backend-datasource/, but with no success.

Then I've found this community post which says that simple json data source already supports that, though not officially:

https://community.grafana.com/t/when-the-alert-can-support-simple-json-datasource/11046/6

And it is available at

https://github.com/grafana/simple-json-datasource/tree/backend-updated

So it seems to be a matter of porting it into simpod's implementation.

@simPod
Copy link
Owner

simPod commented Aug 13, 2019

PRs are welcome! I don't fancy golang development, so probably won't give it a shot personally.

@andig
Copy link
Collaborator

andig commented Aug 13, 2019

I don't fancy golang development, so probably won't give it a shot personally.

...which is a shame as go is really an amazing language. I've come to really like it during the last 2 years.

@simPod
Copy link
Owner

simPod commented Aug 13, 2019

I hate the ecosystem around it, building a dep management, don't have nerves for it :D any other language is fine with me ;)

@andig
Copy link
Collaborator

andig commented Aug 13, 2019

I hate the ecosystem around it, building a dep management

True- GOPATH and non-existance modules were the worst things. However, times have changed since go 1.11: https://blog.golang.org/using-go-modules. And the tooling is really good once you get used to it; e.g. go run has a built-in race detector ;)

@simPod simPod added backlog Would like it to be implemented and removed pinned labels Sep 24, 2019
@istvan86-nagy
Copy link

Now that the new Grafana version (v7.0) is out, is there a chance that this feature can be added?

Would be highly appreciated! :)

@andig
Copy link
Collaborator

andig commented May 29, 2020

Nope. Alerts are for backend datasources. This one is frontend.

Correcting myself after reading #34 (comment)

@natenho would you feel like providing a diff of the backend tree highlighting the needed changes?

@istvan86-nagy
Copy link

I don't know if that helps, my question was based on this:

One limitation with these plugins are that they execute on the client-side (in the browser) which makes it hard to support certain use cases/features, e.g. enable Grafana Alerting for data sources. Grafana v7.0 adds official support for backend plugins which removes this limitation. At the same time it gives plugin developers the possibility to extend Grafana in new and interesting ways, with code running in the backend (server side).

Reference: https://grafana.com/docs/grafana/latest/developers/plugins/backend/

@ash-ghub1
Copy link

Is there a way to let Grafana populate the alert Tab?
I am not looking for an actual implementation, just allow the data to be saved in the dashboard's JSON (and subsequent alert tables in the database).
We already use that information but the latest upgrade resulted in the alert tab being disabled.

@ash-ghub1
Copy link

A workaround is to add a dummy "alert" to the JSON model of the panel, then save and edit.
"alert": {
"conditions": [
{ "evaluator": { "params": [ 1 ], "type": "gt" },
"operator": { "type": "and" },
"query": { "params": [ "A","15m","now-5m" ] },
"reducer": {"params": [],"type": "avg"},
"type": "query"
}
],
"executionErrorState": "keep_state",
"for": "5m",
"frequency": "5m",
"handler": 1,
"name": "ALERT-NAME - Please change Me",
"noDataState": "no_data",
"notifications": [],
"alertRuleTags": {}
},

@ash-ghub1
Copy link

Found it:
src/dist/plugin.json
"alerting": true

@simPod
Copy link
Owner

simPod commented Jul 29, 2020

Alert panel can be populated by setting the Alert setting component in https://github.com/simPod/grafana-json-datasource/blob/master/src/module.ts

@ash-ghub1
Copy link

been trying to find the exact setting, is it "setAlert(xxxx)" ?

@simPod
Copy link
Owner

simPod commented Aug 24, 2020

Ah, my bad. I mistaken it for annotations. I don't know anything about alerts for now.

@stale
Copy link

stale bot commented Oct 7, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Oct 7, 2020
@stale stale bot closed this as completed Oct 14, 2020
@KrisztianKaszas
Copy link

@simPod our dev team is considering to assist you with adding Alerting Support. What would you actually require? Did you do some requirement analysis, what is missing to support this feature, you could share with us?

@simPod
Copy link
Owner

simPod commented Sep 19, 2023

Hello @KrisztianKaszas. That would be great. I have not done any analysis.

If I were to implement it, I'd look into other datasources for examples, e.g., https://github.com/grafana/clickhouse-datasource/blob/main/src/plugin.json

@simPod simPod reopened this Sep 19, 2023
@github-actions
Copy link

This issue has been automatically marked as stale because it has not
had recent activity. It will be closed if no further activity occurs.

@github-actions github-actions bot added the stale label Oct 20, 2023
@github-actions
Copy link

This issue has not seen any activity since it was marked stale.
Closing.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Would like it to be implemented enhancement New feature or request help wanted Extra attention is needed stale wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

8 participants