-
Notifications
You must be signed in to change notification settings - Fork 174
Use podMonitor instead of serviceMonitor to prevent monitoring data leakage #108
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
base: main
Are you sure you want to change the base?
Conversation
|
Why not split the service?
|
At that point, why add another Service? |
|
|
TargetDown doesn't require a Service. It requires a prometheus scrape job, which is created by using any of ServiceMonitor, PodMonitor, ScrapeConfig, Probe, etc. (ps. I wrote that runbook). As for preventing data leakage, that's exactly a point of using PodMonitor. You have less moving parts and less points which can lead to data leakage. |
The language is all around
|
|
Hi @paulfantom, please recommit with signed commits. Also, I would prefer to have backward compatible behavior - ie, if people are using service monitor, they should continue to use service monitors on upgrade. I see value in being able to decide, at the end-user level, whether to use a podMonitor or a service monitor |
…eakage Signed-off-by: paulfantom <[email protected]>
9ec4747 to
f913e55
Compare
|
I've added my signature. As for backwards compatibility, IMHO requiring to have both objects (PodMonitor and ServiceMonitor) being optional puts unnecessary load on maintainers while not providing any tangible value. From prometheus perspective, any object (PodMonitor or ServiceMonitor) will result in the same data being gathered. While from maintenance perspective using ServiceMonitor requires additional logic to be present, ex. Service which exposes metrics port or defining metrics port value. Having both, doesn't give you any benefits while forcing to maintain more code and providing unclear API to end users. However since it is clearer to see in code, I've decided to create a branch where this should be clearly visible - https://github.com/twuni/docker-registry.helm/compare/main...paulfantom:docker-registry.helm:pod-sm-together?expand=1, especially check From my perspective, your API that should be backwards compatible is not in installed objects (when they provide the same results), but in That said, I am not a maintainer and it is up to you to choose a path forward :) |
@paulfantom I actually really like the approach you outlined above ^^ A major problem I see with removing ServiceMonitor is that if I am setting
But IMO that would be confusing. Why does setting |
This PR is a different (IMHO proper) fix to issue raised in #107. By using PodMonitor instead of ServiceMonitor we can simplify and fix a few things:
.Values.metrics.portis no longer needed as PodMonitor attaches to Pod instead of SVC.The downside is that this is a breaking change. Alternative approach which is not breaking, but also not fixes all those issues is in