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 support for unified alerting queries #135

Merged
merged 2 commits into from
Jun 9, 2022

Conversation

toddtreece
Copy link
Member

@toddtreece toddtreece commented Jun 7, 2022

This adds support for Unified Alerting by switching from long to wide time series frames. Fixes #132

Get property value aggregates:
image

Get property value history:
image

Get property value:
image

I can limit this change to alert queries, but the change also fixes time series rendering in panels and explore.

Before:
image

After:
image

@@ -63,6 +65,11 @@ func (s *Server) handlePropertyValueHistoryQuery(ctx context.Context, req *backe
return DataResponseErrorRequestFailed(err)
}

wide, err := data.LongToWide(frames[0], &data.FillMissing{Mode: data.FillModeNull, Value: math.NaN()})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks great -- but would love to see the test structure change to show we now return a wide frame

// }
// Name: Demo Turbine Asset 1
// Dimensions: 2 Fields by 35 Rows
// +-------------------------------+--------------------------+
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ryantxu here's an example

@toddtreece toddtreece changed the title Add support for unified allerting queries Add support for unified alerting queries Jun 9, 2022
@toddtreece toddtreece requested a review from ryantxu June 9, 2022 20:49
Copy link
Contributor

@lean257 lean257 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pulled down and tested and worked for me!

@toddtreece toddtreece merged commit a1148ca into main Jun 9, 2022
@toddtreece toddtreece deleted the toddtreece/unified-alerting-support branch June 9, 2022 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issues creating alerts
3 participants