-
Notifications
You must be signed in to change notification settings - Fork 612
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
feat: initial Prometheus analyzers #855
Conversation
8ea968e
to
7a65e21
Compare
Quick demo: k8sgpt-prom-demo.movThe output isn't perfect. I'm betting we can improve with a better prompt... |
Also for the Maybe there's a better way to do this as well. |
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.
Thank you for this awesome contribution 🤩 . I'm really excited to add this integration. Left some comments
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 @matthisholleville - pushed some changes per your comments!
Overall comment - great contribution and thank you for helping us figure out what we want integrations to be. I am glad the pattern itself is holding up okay and kudos to figuring it out. I do think there should be some guard rails if you In future, ( maybe kubecon ) the contributors need to talk about that wider vision of how integrations will look - I am very excited to have a Prometheus component though. |
Demo: Thanks @AlexsJones - added the functionality to |
Added a prometheus integration with two analyzers: 1. PrometheusConfigValidate 2. PrometheusConfigRelabelReport The integration does not deploy any Prometheus stack in the cluster. Instead, it searches the provided --namespace for a Prometheus configuration, stored in a ConfigMap or Secret. If it finds one, it unmarshals it into memory and runs the analyzers on it. PrometheusConfigValidate checks if the actual Prometheus configuration is valid or has any errors. PrometheusConfigRelabelReport tries to distill the scrape config relabeling rules to give a concise label set per job that targets need to have to be scraped. This analyzer is unconventional, in that it does not necessarily mean there are issues with the config. It merely tries to give a human-readable explanation of the relabel rules it discovers, leaning on the LLM and prompt. Tested on both kube-prometheus and Google Managed Prometheus stacks. Signed-off-by: Daniel Clark <danielclark@google.com>
Simplify ConfigValidate prompt and add comments. Signed-off-by: Daniel Clark <danielclark@google.com>
Add Prometheus configuration discovery to integration activate command. Also improve logging to make this more clear to users. Signed-off-by: Daniel Clark <danielclark@google.com>
83fe66c
to
ca04575
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
Closes #
📑 Description
Added a prometheus integration with two analyzers:
PrometheusConfigValidate
PrometheusConfigRelabelReport
The integration does not deploy any Prometheus stack in the cluster.
Instead, it searches the provided
--namespace
for a Prometheusconfiguration, stored in a ConfigMap or Secret. If it finds one, it
unmarshals it into memory and runs the analyzers on it.
PrometheusConfigValidate
checks if the actual Prometheus configuration is valid or hasany errors.
PrometheusConfigRelabelReport
tries to distill the scrape configrelabeling rules to give a concise label set per job that targets need
to have to be scraped. This analyzer is unconventional, in that it does
not necessarily mean there are issues with the config. It merely tries
to give a human-readable explanation of the relabel rules it discovers,
leaning on the LLM and prompt.
Tested on both kube-prometheus and Google Managed Prometheus
stacks.
✅ Checks
ℹ Additional Information