Skip to content
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

Merged
merged 4 commits into from
Jun 26, 2021

Conversation

aantn
Copy link
Collaborator

@aantn aantn commented Jun 24, 2021

No description provided.

…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)
Copy link
Contributor

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?

Copy link
Collaborator Author

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.

Source: https://github.com/AICoE/prometheus-api-client-python/blob/master/prometheus_api_client/prometheus_connect.py#L54

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"]
Copy link
Contributor

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

@arikalon1
Copy link
Contributor

I had 2 small comments, leaving it to you to merge. Nice work

@aantn aantn merged commit 33834a1 into master Jun 26, 2021
@aantn aantn deleted the alert_integration_improvements_and_enrichers branch June 26, 2021 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants