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

Prevent invalid metric filter creation in alert resources #75

Merged
merged 1 commit into from
Aug 22, 2024

Conversation

grepory
Copy link
Contributor

@grepory grepory commented Aug 21, 2024

When no include_tags or exclude_tags are provided for alert resources, an empty metric filter object with the AND operator was created on the metric condition. This can yield errors in the backend. Do not instantiate a metric filter unless there are tags to include/exclude.

While I was at it, I also did some typo cleanup and removed the unused/undocumented "type" field from the alert resource.

@grepory grepory requested a review from a team as a code owner August 21, 2024 13:45
@grepory grepory force-pushed the grepory/invalid-metric-filter branch 2 times, most recently from 4d12d1d to d92551b Compare August 21, 2024 18:36
When no include_tags or exclude_tags are provided for alert resources,
an empty metric filter object with the AND operator was created on
the metric condition. This can yield errors in the backend. Do not
instantiate a metric filter unless there are tags to include/exclude.

Guard against missing optional fields in alert resources
@grepory grepory force-pushed the grepory/invalid-metric-filter branch from d92551b to e140ba8 Compare August 22, 2024 16:43
@michael-anderson-swi michael-anderson-swi merged commit fe78350 into main Aug 22, 2024
1 check passed
@grepory grepory deleted the grepory/invalid-metric-filter branch September 25, 2024 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants