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

Always apply handlers in order #162

Merged
merged 3 commits into from
Sep 7, 2021

Conversation

malcolmholmes
Copy link
Collaborator

Grizzly consumes code from Tanka that extracts "manifests" from a
JSON tree (i.e. output from Jsonnet script). This is returned as a
map[string]manifest.Manifest. As this is a map, it is unordered,
meaning resources are returned in a different order each time.

This can cause problems when ordering matters, notably when a
dashboard is applied before its folder.

This PR creates a consistent ordering for resources, they will
always be processed in consistent handler order.

Note, ordering within a handler will not (yet) be consistent, but
this shouldn't cause issues.

NewRuleHandler(*p),
NewSyntheticMonitoringHandler(*p),
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Datasources -> Folders -> Dashboards -> Prometheus Rules -> Synthetic Monitoring seems a reasonable order of precedence.

@malcolmholmes malcolmholmes force-pushed the malcolmholmes/consistent-resource-ordering branch from d8e02cc to cac0141 Compare August 27, 2021 12:21
Copy link
Collaborator

@dsotirakis dsotirakis left a comment

Choose a reason for hiding this comment

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

LGTM! 🚀

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.

None yet

2 participants