GrafanaJsonDatasource icon indicating copy to clipboard operation
GrafanaJsonDatasource copied to clipboard

Add alerting support

Open pcolladosoto opened this issue 1 year ago • 6 comments
trafficstars

Hi @simPod! As seen on #34 there was some interest in having alerting support for the plugin.

I'm currently working on developing an OSS plugin for MongoDB databases and decided to base it off GrafanaJsonDatasource given how neat and to the point the codebase is.

In an effort to make alerting available for the soon-to-be MongoDB plugin I decided to add a full-fledged backend support to the GrafanaJsonDatasource plugin. Given how helpful it's been, the least I could do was to add this backend support before the code bases diverged so that you could integrate it into the plugin if you wanted to.

Anyhow, this PR strives to add a Go-based backend to the plugin so that it can leverage Grafana built-in goodies such as alerting. If I'm honest, the Infinity datasource plugin could be a bit overkill and, what's more, it doesn't add support for interactively building the query AFAIK.

Please bear in mind that the PR's contents are (very) rough around the edges. I just wanted to share the work before trying to transition it to something more robust to make sure you were interested. Otherwise I can just begin swapping out the HTTP-based backend for a MongoDB-based one and call it a day.

Also, please note that I have absolutely no idea about JS and the accompanying development environment. I've tried to play with it as little as possible but I do have some doubts; especially about how the ad-hoc filters can be applied.

Anyway, sorry for all the rambling and thanks for building GrafanaJsonDatasource and making it public 😄

P.D: Bear in mind some changes such as the authorship and so on have been altered thinking about the MongoDB plugin. All these changes can be revisited should a merge take place.

pcolladosoto avatar Sep 04 '24 15:09 pcolladosoto

Hello @pcolladosoto, I'm currently on currently on kitesurfing holiday so I'll review this the next week when I get back home. I don't consider myself a Go developer but definitely can take a look. Thank you for your contribution in advance.

simPod avatar Sep 04 '24 19:09 simPod

No worries! Have a great one! 🪁 🏄🏾

pcolladosoto avatar Sep 05 '24 07:09 pcolladosoto

Hi @simPod! Thanks a ton for the comments and the change requests! I'll be a bit busy this week, but I didn't want to go without saying that all your suggestions are on point. Given I used this datasource plugin as a stepping stone towards a MongoDB datasource I just opened the PR before the codebase began diverging a bit more. I just wanted to make sure you were interested in the PR before honing down on the different rough edges. I'll be sure to address what you brought up plus all the other TODOs I littered here and there... Thanks again!

pcolladosoto avatar Sep 22 '24 16:09 pcolladosoto

Dear @simPod, as mentioned in #34 we also planned to do the same. With a year delay, we also started in August to build a grafana backend plugin around the data source plugin, but due to some personal bottlenecks we did not get so far as @pcolladosoto yet.

Do I understand right, the plan is to add @pcolladosoto solution to 0.7.x so we can put our efforts to achieve the same task on hold?

Is there an ETA when 0.7.x will got this feature? Can we assist with this in any way?

KrisztianKaszas avatar Sep 24 '24 13:09 KrisztianKaszas

Hi @KrisztianKaszas! My idea is to try and address the comments next week. However, I would really appreciate it if a second pair of eyes had a look at the changes: I'm sure there are many things to be improved!

Hopefully by the end of next week this PR can move into a review stage where all the changes have been migrated, hopefully making the inclusion in the plugin a reality soon.

Thanks a ton for your comment!

pcolladosoto avatar Sep 24 '24 13:09 pcolladosoto

Hi @pcolladosoto, we will do a PR as well and will try to run some tests with our existing Grafana solution, that is using this great data source. If we find anything, will address them. BR!

KrisztianKaszas avatar Sep 25 '24 08:09 KrisztianKaszas

This pull request 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.

github-actions[bot] avatar Oct 26 '24 02:10 github-actions[bot]

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

github-actions[bot] avatar Nov 02 '24 02:11 github-actions[bot]

Our developer has finished testing this request in November 2024 and did not found any issues. However it seems that his comment lost.

What are the plans with this feature?

KrisztianKaszas avatar Jan 16 '25 14:01 KrisztianKaszas

It's still free to be implemented.

simPod avatar Jan 16 '25 15:01 simPod

Hi @simPod and @KrisztianKaszas! Your comments triggered an email that reached my inbox and brought this back to my attention. Sorry about that...

I'll try to address the comments (for real this time :P) shortly. Sorry again for the delay...

pcolladosoto avatar Jan 16 '25 19:01 pcolladosoto

Hi @simPod! I've pushed most of the requested changes to my fork (i.e. pcolladosoto/gtom-native). I've also rebased everything on top of the current branch so as to avoid any possible merge conflicts.

However, it seems that I cannot reopen the PR after the GitHub bot closed it up... Could you please reopen it and/or open a new one? I don't want to mess things up too much...

At any rate, if you could have a look at the changes we can continue to move things along.

Sorry for the delay in getting to this...

Have a great one!

pcolladosoto avatar Jan 18 '25 11:01 pcolladosoto

Hi @simPod! it seems the pull request was closed again with unmerged commits. Is there a way to bring this on back on track? Have a nice day!

KrisztianKaszas avatar Feb 24 '25 16:02 KrisztianKaszas

Sorry all, I'm kind of stuck as I've not upgraded to Grafana v11 yet so I had no time for this either.

simPod avatar Mar 11 '25 22:03 simPod

@pcolladosoto can you recreate PR? I'm unable to reopen this

image

simPod avatar Mar 11 '25 22:03 simPod

@pcolladosoto / @simPod is there anything we can do? Since we have tested these commits, we could try to create a new ticket with the commits as well?

KrisztianKaszas avatar Mar 31 '25 08:03 KrisztianKaszas

Let's recreate the PR for start

simPod avatar Mar 31 '25 08:03 simPod

Hi @simPod and @KrisztianKaszas! I just opened #689 to try and push the changes through. I'll do my best to reply as quickly as possible!

Please be sure to let me know about anything that might be missing.

Let's see if we can add this once and for all...

Thanks for your time!

pcolladosoto avatar Mar 31 '25 09:03 pcolladosoto