-
Notifications
You must be signed in to change notification settings - Fork 14
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 support for Events Stats queries #225
Conversation
ac38915
to
edda72a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this contribution! Event stats queries work great 😃
Since the JSON result is polymorphic and doesn't really have any predetermined field names (except for meta), the unmarshalling of the data is not incredibly elegant. I'm new to go so maybe there's a cleaner way, but from my googling there wasn't an obvious better way.
This is similar to how we handle undefined data in other plugins. It's always kind of difficult.
One difference from the Stats query is that I don't provide an Interval field, but instead derive that from the built in query options which IMHO feels more Grafana native and more user friendly.
Agreed.
The UX of the query editor could be improved by providing a click based builder like the Sentry Dashboard, but I think this is a good start.
Good callout but like you said this is absolutely a good start.
I have a few minor nits, but everything else looks great. I am not as familiar with this code as @asimpson. He will be back in the office next week, and with his approval, we can merge this in. Thank you again!
@asimpson Eager to start using this datasource 😄 Would be greatly appreciated if you would have a look at this one! Thanks 🙇 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution here @oblador! Some comments from me below, once resolved we'll be happy to go ahead and merge this one 👍
Thanks for the review @adamyeats! I think I've addressed all points now 👍 |
Thanks for being so on top of this @oblador ! Looks like there's some test failures here, would you be able to take a look? I've attached log output here in case you're unable to access the link to Drone. |
@adamyeats I'm not so familiar with go tool chain, so I can't say exactly why but those failures seems to be cache related. If you do |
@oblador The output I attached to my previous comment was from CI, you can see the output here. This doesn't look cache related to me, as our pipeline doesn't cache anything test related. This seems to be an intermittent issue that I'm also able to reproduce locally, even after running A colleague has pointed out to me that this might be because the ordering of fields isn't guaranteed. If we want it to be guaranteed then the fields would have to be sorted. There is an example of this in another datasource here. Apologies for not catching this in my review and thank you for your continued work on this! |
@adamyeats Aah, thanks for the insight! I refactored the tests to use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oblador Nice! Very happy to merge this in, thanks for your hard work. I'll talk to the team and aim to get a new release out with this included ASAP.
What did the release team say? Anything blocking a release? 😊 |
I'd be keen to start using this too so would be great if it could be released! 🙂 |
@adamyeats Apologies for being pushy, but I would really need to get this released soon. Would you mind reaching out to the team? I trust the release is automated anyways. Thanks! |
@oblador Apologies for the delay here! I have published 1.7.0 this afternoon with your changes included. Let us know if there are any problems and thank you for your patience here! |
Awesome, thank you! |
This PR adds support for Events Stats queries, which is the type that drives the Sentry Dashboards, which gives you a time series result unlike the regular Events.
Since the JSON result is polymorphic and doesn't really have any predetermined field names (except for meta), the unmarshalling of the data is not incredibly elegant. I'm new to go so maybe there's a cleaner way, but from my googling there wasn't an obvious better way.
One difference from the Stats query is that I don't provide an
Interval
field, but instead derive that from the built in query options which IMHO feels more Grafana native and more user friendly.The UX of the query editor could be improved by providing a click based builder like the Sentry Dashboard, but I think this is a good start.
Closes #33