-
Notifications
You must be signed in to change notification settings - Fork 255
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
Alert integration improvements and enrichers #2
Conversation
…update docs try try out the new features add the following to your active_playbooks.yaml: - name: "alerts_integration" action_params: slack_channel: "your_channel" default_enrichers: - name: "AlertDefaults" - name: "GraphEnricher" - name: "StackOverflowEnricher"
|
||
def enrich(self, alert: PrometheusKubernetesAlert): | ||
url = urlparse(alert.alert.generatorURL) | ||
prom = PrometheusConnect(url=f"{url.scheme}://{url.netloc}", disable_ssl=True) |
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.
what does disable_ssl means? it wouldn't work if prometheus is configured with ssl?
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.
It works with ssl - its just a bad choice of a parameter name in the library we use.
The parameter disables verifying the ssl certificate - this prevents PrometheusConnect from failing if you have a self-signed certificate.
def show_stackoverflow_search(event: ReportCallbackEvent): | ||
# TODO: handle context loading + itsdangerous security at the framework level | ||
context = json.loads(event.source_context) | ||
alert_name = context["alert_name"] |
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 would make it more generic, i.e. any search term, and not alert.
it obviously will work with any search phrase, I would just name it 'search_term' or something
I had 2 small comments, leaving it to you to merge. Nice work |
No description provided.