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

Sane Opsgenie alerting #487

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

Sane Opsgenie alerting #487

wants to merge 5 commits into from

Conversation

wejdross
Copy link
Member

PR ensures we have new Opsgenie alerts that self resolve depending on time window, so we keep our Responsible Ops sane. It leaves old logic generated by Sloth tool, but disables forwarding alerts to Opsgenie.

Checklist

  • The PR has a meaningful title. It will be used to auto generate the
    changelog.
    The PR has a meaningful description that sums up the change. It will be
    linked in the changelog.
  • PR contains a single logical change (to build a better changelog).
  • Categorize the PR by adding one of the labels:
    bug, enhancement, documentation, change, breaking, dependency
    as they show up in the changelog.
  • Link this PR to related issues or PRs.

@wejdross wejdross added the enhancement New feature or request label Sep 23, 2024
@wejdross wejdross self-assigned this Sep 23, 2024
Copy link
Contributor

@Kidswiss Kidswiss left a comment

Choose a reason for hiding this comment

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

OnCall != Ops ;)

@@ -86,7 +86,7 @@ local generateSlothInput(name, uptime) =
},
labels+: {
service: 'VSHN' + name,
OnCall: '{{ if eq $labels.sla "guaranteed" }}true{{ else }}false{{ end }}',
OnCall: false,
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's remove this label completely, it doesn't serve any purpose anymore.

Also, this alone will not disable alerting to OpsGenie during office hours. This only disables routing to oncall. So whoever does ops will still get bothered by these alerts. You'll have to investigate how to disable the routing to OpsGenie. It might even need a new routing rule.

alert: 'vshn-' + std.asciiLower(serviceName) + '-opsgenie-ha',
// this query can be read as: if the rate of probes that are not successful is higher than 0.2 in the last 5 minutes and in the last minute, then alert
// rate works on per second basis, so 0.2 means 20% of the probes are failing, which for 5 minutes is 1 minute and for 1 minute is 12 seconds
expr: 'rate(appcat_probes_seconds_count{reason!="success", service="' + serviceName + '", ha="true", maintenance="false"}[5m]) > 0.2 and rate(appcat_probes_seconds_count{reason!="success", service="' + serviceName + '", ha="true", maintenance="false"}[1m]) > 0.2',
Copy link
Contributor

Choose a reason for hiding this comment

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

You have to remove the maintenance="false" here.

If HA instances trigger an alert during maintenance, it should be considered broken and investigated.

Also the 12seconds within 1 minute might be a bit too low for that case, as there will be failovers during the maintenance, maybe we should increase it a bit to avoid false positives?

Copy link
Member Author

Choose a reason for hiding this comment

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

I just increased value for 1 minute to 45 second instead of 12, that should eliminate false positives

Copy link
Member Author

@wejdross wejdross Sep 23, 2024

Choose a reason for hiding this comment

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

also removed maitenance label

component/vshn_alerting.jsonnet Outdated Show resolved Hide resolved
component/vshn_alerting.jsonnet Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants