Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add validation for pod/service monitors for TargetAllocator and skip invalid ones #2328
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 validation for pod/service monitors for TargetAllocator and skip invalid ones #2328
Changes from 14 commits
1b7e32b
a55e688
401ad2c
b582198
1a90fae
2c276dc
e97f969
26843ed
533dff8
537a2bb
90bcb75
dfcc746
5406145
883b583
7885db1
83abf55
c9f3aa5
436b888
319e72f
4fc1403
a943cdb
bf33615
bc6dc56
b627b24
b742f0a
d062dbd
859ed13
da40b95
f0bc9d2
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
we should be defaulting these to empty so that we can keep the current behavior (link)
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 @jaronoff97. Since the common prometheus fields have the ServiceMonitorNamespaceSelector and PodMonitorNamespaceSelector already initialized, even if the targetallocator config is not setting these selectors (or have nil selectors), the default behavior will be to match all namespaces which is the current behavior. But I can add defaults, in case you think otherwise. Please let me know.
The following tests also depict the behavior with no selectors in the config vs with selectors.
https://github.com/open-telemetry/opentelemetry-operator/blob/883b583c4c93038d6fddc55b192659c4aa90f0fe/cmd/otel-allocator/watcher/promOperator_test.go#L91C4-L91C34
https://github.com/open-telemetry/opentelemetry-operator/blob/883b583c4c93038d6fddc55b192659c4aa90f0fe/cmd/otel-allocator/watcher/promOperator_test.go#L505C3-L509C6