Skip to content

Commit

Permalink
Add logo, code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesread committed Jul 25, 2024
1 parent c3e10d5 commit e8d5912
Show file tree
Hide file tree
Showing 8 changed files with 101 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .air.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ tmp_dir = "tmp"

[build]
args_bin = []
bin = "./upsilon-alert-receiver"
cmd = "go build -o ./upsilon-alert-receiver cmd/upsilon-alert-receiver/main.go"
bin = "./uar"
cmd = "go build -o ./uar cmd/uncomplicated-alert-receiver/main.go"
delay = 1
exclude_dir = ["assets", "tmp", "vendor", "testdata"]
exclude_file = []
Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# uncomplicated-alert-receiver

A robust and reliable prometheus alert receiver intended for heads up displays. It works without internet access, external dependencies, configuration files, storage, and generally has very few things to go wrong.
A robust and reliable Prometheus alert receiver intended for heads up displays. It works without internet access, external dependencies, configuration files, storage, and generally has very few things to go wrong.

It is designed to supplement other alert receivers, which typically are used for sending notifications, such as email, slack, pagerduty, etc. It is not a replacement for those services, but a supplement to them.

### Why, what problem does this solve?

For years, I tried to create better and better Grafana dashboards on my heads up displays, cycling dashboards, showing pretty pictures and graphs. I agonized over making dashboards that displayed the right information at the right time, but something was missing. The problem was the noise, I was being shown all this information constantly as pretty graphs and visualizations, but Grafana has no idea if something is actually wrong - it's fundamentally just a pretty way to display data. What I was missing, was alerts from Prometheus when something was wrong, and then I would use Grafana to explore the information and try to figure out why. Now I have alerts on my heads up displays, and Grafana's role is on my desktop browser to explore the data, not on my heads up displays.

Additionally, this project is designed to be extremely robust, and reliable, and simple. It does one job (hopefully well). For day to day usage, or just referred to in emergencies, it should "just work".

### **This is a No-Nonsense Open Source project;**

Expand Down
12 changes: 9 additions & 3 deletions cmd/uncomplicated-alert-receiver/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,19 @@ func handleAlert(alert *Alert) {
func buildURL(alert *Alert) string {
host := os.Getenv("ALERTMANAGER_HOST")

if host == "" {
return "#"
}

return fmt.Sprintf("%v/#/alerts?filter={%v}", host, buildURLFilter(alert))
}

func buildURLFilter(alert *Alert) string {
v := ""

filterKeys := []string{"job", "instance"}

for i, k := range filterKeys {
log.Infof("k: %v %v", k, alert.Labels[k])

v += fmt.Sprintf("%v=\"%v\"", k, alert.Labels[k])
v = strings.ReplaceAll(v, "=", "%3D")

Expand All @@ -71,7 +77,7 @@ func buildURL(alert *Alert) string {
}
}

return fmt.Sprintf("http://%v/#/alerts?filter={%v}", host, v)
return v
}

func getAllAlerts() http.HandlerFunc {
Expand Down
Binary file added var/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
79 changes: 79 additions & 0 deletions var/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added webui/images/icons/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed webui/images/icons/upsilon.png
Binary file not shown.
4 changes: 2 additions & 2 deletions webui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
<title>Uncomplicated Alert Receiver</title>

<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="shortcut icon" href="images/icons/upsilon.png">
<link rel="shortcut icon" href="images/icons/logo.png">

<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>

<body>
<header>
<img src = "images/icons/upsilon.png" alt = "Uncomplicated Logo">
<img src = "images/icons/logo.png" alt = "Uncomplicated Alert Receiver Logo">
<h1>Uncomplicated Alert Receiver</h1>
</header>

Expand Down

0 comments on commit e8d5912

Please sign in to comment.