-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: enables prometheus rules and alerts (#292)
* feat: enables prometheus rules and alerts which can be sent to alertmanager * chore: adding configs for alertmanager, alert, and prom * chore: alerts WIP * chore: alerts WIP * chore: alerts WIP * chore: setRules API will update rules * chore: initialization of prometheus related stuff moved to separate function * chore: alerts WIP * chore: alerts WIP * fix: r.promConfig was nil * feat: routing alertmanager apis to alertmanager service at nginx * chore: not writing to localDB if string parsing gives error * feat: list alerts API * chore: error in creating multiple groups * feat: CRUD APIs for rules working * chore: changed prometheus version * chore: updated AlertingRuleResponse struct's Id json value * chore: updated prometheus's version * chore: will load rules from database on bootup * feat: crud APIs for notification channels WIP * fix: changed ALERTMANAGER_API_PREFIX * chore: enabling scrape and notify discover manager * chore: fixing path for signoz.db * chore: used transactions for rules APIs * chore: editchannel API updated and other apis refactored * chore: fixed merge conflicts * chore: changing createChannel api from yaml to json reader * chore: changing editChannel api from yaml to json reader * chore: porting loadChannels to json format * chore: editRule returning rule not found * chore: pre-release * chore: fixed db path for persistence * release: v0.5.0
- Loading branch information
1 parent
849c3d1
commit 28bf2fe
Showing
18 changed files
with
1,457 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
global: | ||
resolve_timeout: 1m | ||
slack_api_url: 'https://hooks.slack.com/services/xxx' | ||
|
||
route: | ||
receiver: 'slack-notifications' | ||
|
||
receivers: | ||
- name: 'slack-notifications' | ||
slack_configs: | ||
- channel: '#alerts' | ||
send_resolved: true | ||
icon_url: https://avatars3.githubusercontent.com/u/3380462 | ||
title: |- | ||
[{{ .Status | toUpper }}{{ if eq .Status "firing" }}:{{ .Alerts.Firing | len }}{{ end }}] {{ .CommonLabels.alertname }} for {{ .CommonLabels.job }} | ||
{{- if gt (len .CommonLabels) (len .GroupLabels) -}} | ||
{{" "}}( | ||
{{- with .CommonLabels.Remove .GroupLabels.Names }} | ||
{{- range $index, $label := .SortedPairs -}} | ||
{{ if $index }}, {{ end }} | ||
{{- $label.Name }}="{{ $label.Value -}}" | ||
{{- end }} | ||
{{- end -}} | ||
) | ||
{{- end }} | ||
text: >- | ||
{{ range .Alerts -}} | ||
*Alert:* {{ .Annotations.title }}{{ if .Labels.severity }} - `{{ .Labels.severity }}`{{ end }} | ||
*Description:* {{ .Annotations.description }} | ||
*Details:* | ||
{{ range .Labels.SortedPairs }} • *{{ .Name }}:* `{{ .Value }}` | ||
{{ end }} | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
groups: | ||
- name: ExampleCPULoadGroup | ||
rules: | ||
- alert: HighCpuLoad | ||
expr: system_cpu_load_average_1m > 0.1 | ||
for: 0m | ||
labels: | ||
severity: warning | ||
annotations: | ||
summary: High CPU load | ||
description: "CPU load is > 0.1\n VALUE = {{ $value }}\n LABELS = {{ $labels }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.