-
Notifications
You must be signed in to change notification settings - Fork 25
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
helm: enable prometheus autodiscovery #393
helm: enable prometheus autodiscovery #393
Conversation
de1f636
to
cdce5b6
Compare
I'm not sure if I'm missing some context, but could you clarify why we need to introduce these annotations when we already have Helm flags that control the instrumentation of the balloons policy CR? The only reason I can think of for having two methods to enable scraping on the pod would be to allow overriding the default port and scraping settings. Is that the case, or is there something else at play here? Also, the |
There is no existing helm flag to control instrumentation, only a CR configuration setting. There is a Helm value to expose the metrics port to a host port which should not be necessary at all and is removed by this PR, or actually converted to generic port expose mechanism. All in all, the purpose of this PR is to
|
If that is the case then I screwed up the latest rebase. The ide is exactly to provide a way to inject arbitrary annotations. But in addition to any custom annotations by Helm config we always annotate for prometheus auto-discovery. |
btw, what is prometheus auto-discovery, do you have some reference documentation ? |
I guess you mean that you want the pod to advertise itself as it it can be scraped by prometheus right? like sending ARP |
Yes. |
I just googled for autodiscovery then found a few articles describing it. For instance,
|
There is:
|
Don't we need |
That would only be necessary if we exposed our metrics on a non-standard path, something else than the default |
5ba8185
to
5092c00
Compare
That is not a genuine Helm-level setting. It is part of the Helm-level opaque config YAML blob we inject into the default policy CRD. If you look at |
8df426f
to
650cee4
Compare
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.
LGTM
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.
I've got only one question on this.
Could we enable installation so that only the port name
is defined but the host
is not? That is, we would not ever specify hostPort
unless user very very much wants it there.
Allow autodiscovery of prometheus metrics by annotation. IOW, annotate our plugins' pods according to the Helm `config.instrumentation.{prometheusExport,httpEndpoint}` values. Since we're adding annotations to our plugins' pods, add support for injecting custom annotations using the Helm `plugin.annotations` value. Signed-off-by: Krisztian Litkey <[email protected]>
Since it's now uneccessary to expose our custom metrics port on the host side, remove the required and dedicated hostPort Helm value. Add instead an optional generic 'ports' array to allow exposing arbitrary ports to the host. Similarly remove hostPort from the nriplugindeployments CRD. Signed-off-by: Krisztian Litkey <[email protected]>
650cee4
to
b346bc3
Compare
Updated, making |
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.
LGTM
helm: allow autodiscovery by prometheus.
Allow autodiscovery of prometheus metrics by annotation. IOW, annotate our plugins' pods according to the Helm
config.instrumentation.{prometheusExport,httpEndpoint}
values. Since this PR adds annotations to our plugins' pods, add support for additional injection of other custom annotations using the Helmplugin.annotations
value.Also, since it's now uneccessary to expose our custom metrics port on the host side, remove the required and dedicated
hostPort
Helm value. Add instead an optional genericports
array to allow exposing arbitrary ports to the host. RemovehostPort
from thenriplugindeployments
CRD as well.