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

global/prometheus-alertmanager-operated: Added bedrock alerting #7628

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

christophrichtersap
Copy link
Contributor

@christophrichtersap christophrichtersap commented Jan 8, 2025

  • added template definition for bedrock on _helper.tpl
  • added slack receiver for bedrock alerts on am-config-route-slack.yaml
  • added code in helm template to use bedrock template definition in case values.yaml has key bedrockAlerts with list(alertname1 alertname2 alertname3 ...) on prometheus-alerts.yaml

@christophrichtersap christophrichtersap changed the title Prometheus-Alerting: Bedrock alerts global/prometheus-alertmanager-operated: Added bedrock alerting Jan 9, 2025
Copy link
Contributor

@viennaa viennaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for providing this PR and enhancing the vmware-rules with the bedrock use-case. Overall I'd recommend adding some notes around the helpers to help other colleagues understanding it.

Please bump the minor version of prometheus-vmware-rules and the patch version prometheus-alertmanager-operated.

Comment on lines +2 to +3
{{- $bedrockAlerts := .Values.bedrockAlerts }}
{{- $filteredBedrockAlerts := dict }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add an example in the values.yaml showing this behaviour, can be empty or commented out.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed on commit e7d48fd

{{ printf "%s" $bytes | indent 2 }}

{{- $string := $bytes | toString }}
{{- $string := (regexReplaceAll "\\n\\s+\\n" $string "\n\n") }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this replace of newlines?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is required, cause in the past not alerts have been formatted properly in yaml. We can enforce the correct format between alerts to remove the replace.

What is your opinion about that?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd go for proper formatting in the first place, but if we can not assure this drift it is ok to strip the newlines. However please add this as a comment here too.

christophrichtersap and others added 5 commits January 16, 2025 17:30
Resolved: Added commented example of data in `prometheus-rules/prometheus-vmware-rules/values.yaml`
Resolved: Added comments on `prometheus-rules/prometheus-vmware-rules/templates/_helper.tpl`
Copy link
Member

@richardtief richardtief left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm missing the context, but I wouldn't recommend adding that complexity. Still, a few little things I discovered while reading through.

@christophrichtersap
Copy link
Contributor Author

christophrichtersap commented Jan 17, 2025

I'm missing the context, but I wouldn't recommend adding that complexity. Still, a few little things I discovered while reading through.

@richardtief the context is that we need to expose some of the VMWare alerts to bedrock slack channel too not only to VMWare. The other option @viennaa mentioned was creating(duplicating) alerts for bedrock separate.

Chris and I decided for the actual option to avoid double maintenance of nearly identical alerts in future.


# Maintained in the regional secrets
# bedrockAlerts:
# DatastoreDisconnectedWithVmsOnIt: hostsystem
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do we need hostsystem for? As of my understanding this could be a list, as hostsystem is only be checked for existence. Meaning it could be some arbitrary value in the current implementation. Can we make this a list?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ist the variable $mappingKey in prometheus-rules/prometheus-vmware-rules/templates/_helper.tpl

It varies depending on the query used...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could this be any other thing than hostsystem? As for my understanding you are always deciding on this, no?

@viennaa
Copy link
Contributor

viennaa commented Jan 20, 2025

Please bump the minor version of prometheus-vmware-rules and the patch version prometheus-alertmanager-operated.

Please also check on this one ^.

@christophrichtersap
Copy link
Contributor Author

Thanks for providing this PR and enhancing the vmware-rules with the bedrock use-case. Overall I'd recommend adding some notes around the helpers to help other colleagues understanding it.

Please bump the minor version of prometheus-vmware-rules and the patch version prometheus-alertmanager-operated.

Fixed on ac8686c

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.

3 participants