83 Commits

Author SHA1 Message Date
Iain Sproat 20b5b7fdc3 chore(deps): bump go dependencies (#37)
* chore(deps): bump go dependencies

* chore(deps): bump version of git in Dockerfile builder

* downgrade to previous release candidate of git
0.3.2
2024-06-18 08:54:15 +01:00
Iain Sproat f79a6754f5 chore(circleci): update remote docker to prevent 'brownout' (#36)
* chore(circleci): update remote docker to prevent 'brownout'

* Update packages
2024-05-28 16:13:24 +01:00
Iain Sproat c2457d9061 chore(deps): upgrade go mod deps (#35)
* chore(deps): upgrade go mod deps
* go mod tidy
2024-05-02 16:34:55 +01:00
Iain Sproat 6ff13d331f chore(deps): go get update (#34)
* chore(deps): go get update
* go mod tidy
0.3.1
2024-04-03 16:34:59 +01:00
Iain Sproat c701667bf2 chore(circleci): bump docker image versions (#32) 2024-02-23 12:27:04 +00:00
Iain Sproat faa6956b29 chore(helm chart): add priority class name (#31) 0.3.0 2024-02-02 16:31:01 +00:00
Iain Sproat a328544e11 chore(deps): bump go dependencies (#30) 0.2.6 2024-01-29 11:58:00 +00:00
Iain Sproat 035505cb0e chore(deps): bump dependencies (#29) 0.2.5 2024-01-03 19:03:24 +00:00
Iain Sproat 5de0c11f44 chore(deps): bump dependencies (#28)
* chore(deps): bumps numerous dependencies to latest versions
- addresses snyk vulnerabilities
* Bump dockerfile packages
2023-08-08 07:06:14 +01:00
Iain Sproat e7fcdec23d chore(deps): bump all dependencies (#27)
* chore(deps): bumps all go dependencies to latest as of 2023-03-16
* chore(deps): bump version of git to 2.38.4-r1
0.2.4
2023-03-16 18:42:25 +00:00
Iain Sproat 3cf3536256 chore(deps): bump all dependencies (#26)
* chore(deps): bump all dependencies
* chore(docker): bump dependencies
2023-02-07 08:49:24 +00:00
Iain Sproat 1ee293fe6a chore(ssh key): ssh key for helm publishing must have write permissions (#25) 2023-01-05 16:45:37 +00:00
Iain Sproat ad387e2a4d Update SSH Key fingerprint to use Deploy key configured by CircleCI (#24)
* Update SSH Key fingerprint to use Deploy key configured by CircleCI
- removes unused orb reference
- removes unneeded version info

* Bump alpine dependencies
2023-01-05 16:25:18 +00:00
Iain Sproat d4de1e7f3d Copy the files in the build directory, not the directory (#22) 0.2.3 2022-11-25 10:55:42 +00:00
Iain Sproat c67919d0a2 CircleCI was placing tagged versions in incubator instead of stable (#20) 0.2.2 2022-11-25 10:21:02 +00:00
Iain Sproat 62bc6ef79e CircleCI should not build and build-and-publish for tags (#19)
- it should only build-and-publish
2022-11-25 09:55:28 +00:00
Iain Sproat 3b47e55e2a CI(circleci): Adds SSH key fingerprint (#18) 0.2.1 2022-11-24 17:26:36 +00:00
Iain Sproat a2555fcff1 ci(circleci): DOCKER_REG_URL env variable should be optional (#17)
Co-authored-by: abc <i@example.org>
2022-11-24 16:37:45 +00:00
Iain Sproat c6dd80140e Circleci should publish helm chart to gh-pages (#15)
* Update screenshot to match current output
* Add job to Helm package and push to gh-pages branch
* Update .gitignore
* Add job to get version, semver2 compatible
* Only helm publish on main branch
* Add build arg to Dockerfile build command to set application version number
2022-11-24 16:28:00 +00:00
Iain Sproat f2872d6dea Configurable logging levels (#16)
* Update screenshot to match current output
* Log level is configurable
* Alert name is provided in log line, where available.
* Capitalise Discord, check err in integration test, and other syntax issues
* Go formatting syntax fixes
* Log the common alert name or group alert name, in that precedence
2022-11-21 21:04:05 +00:00
Iain Sproat 6c6eef2854 Tab for indentation 0.2.0 2022-11-18 11:33:12 +00:00
Iain Sproat 2d7a7522e0 Summary and environment type are hoisted into discord embed field name 2022-11-18 10:57:09 +00:00
Iain Sproat 95422cf410 Indent annotations and labels within Discord embed 2022-11-18 10:20:38 +00:00
Iain Sproat c1caf51eb9 CircleCI only publishes if pre-commit has passed 2022-11-18 10:12:41 +00:00
Iain Sproat b7fc536214 Sort labels and annotations alphabetically 2022-11-18 09:56:31 +00:00
Iain Sproat 838a1d5fdf Dump all annotations and labels into Discord embed for each alert 2022-11-17 16:54:53 +00:00
Iain Sproat 5a070fed0e Attributes are now included in Discord embed field 2022-11-16 10:03:29 +00:00
Iain Sproat 5193686610 Helm test should run against the readiness endpoint for now. (#10) 2022-11-14 11:56:32 +00:00
Iain Sproat 0ee0afdf99 Update Helm Chart and README (#8) 2022-11-14 10:42:05 +00:00
Iain Sproat b4a48fd928 Refactor and productionise (#6)
* Adds development instructions to README
* Replaces deprecated io/ioutil with io package
* Catch all thrown errors and handle them.
  - not catching errors could result in unknown behaviour
* Fix gofmt formatting issues
* Refactor to allow http client to be provided
  - default client does not have timeout etc., we may instead wish to provide a custom http client.
* Refactor to something closer to the standard go layout
  - separates alert forwarder into separate package to allow for testing/reuse
* Split out types, and split Discord client into its own package
* Renaming of symbols for readability
  - no need to abbreviate words in modern IDEs
* remove go-vet hook as it is broken when go files are not in root directory
* unit tests for ~90% coverage
* Update picture in README
* Return error status codes to caller in event of error from Discord
* Remove panic, replace with error status code response and log message. Improve the status codes that are returned to provide more context on what has occurred.
* Graceful shutdown of server, including signal handling
* Integration tests
  - mocks Discord server
  - tests Happy case and a couple of unhappy cases
  - most edge conditions are otherwise tested in unit tests
* CheckWebHook should return errors instead of logging
  - additional checks in tests for nil objects
  - attempt to solve integration test pollution by using different port numbers to prevent potential collision
  - Temporarily comment out test causing interaction pollution with other tests
* structured logging
* feat(exponential backoff): Added to Discord client
* Serve prometheus metrics
  - Monitoring for the discord client
* adds correlation ID to logging
* refactors the mock http client to allow it to work with instrumentation for monitoring
* Helm chart service monitor
* Improved flag and env var parsing
* Application version passed in via build args
* Order of precedence of configuration configuration file<environment variable<command line
* Mounts secret to file instead of in environment variable
* Adds build tag to integration tests to prevent them being run as a unit test
2022-11-14 09:46:27 +00:00
Iain Sproat a15481f294 Updates README (#3)
* Updates README
  * Update helm instructions.
* Generates README for helm chart
* Adds a schema.json file for helm chart
2022-11-07 22:43:17 +00:00
Iain Sproat 82e9275166 helm chart (#5)
* Helm chart to deploy to kubernetes, including optional CiliumNetworkPolicy
* Support liveness and readiness probes from Kubernetes
* Pre-commit checks for prettier and check-yaml should ignore helm chart templates
2022-11-07 21:10:35 +00:00
Iain Sproat 8f5aef469e Enable pre-commit step in CircleCI (#4) 2022-11-07 20:00:59 +00:00
Iain Sproat 89379c4700 Fixes broken references in CircleCI (#2)
* Fixes broken references in CircleCI
2022-11-07 18:07:02 +00:00
Iain Sproat efb5ce6449 Merge pull request #1 from specklesystems/iain/circleci
CI(pre-commit): adds circleci and pre-commit
2022-11-07 17:57:04 +00:00
Iain Sproat 9826fef9e7 CircleCi workflow configured
- pre-commit job temporarily commented out until pre-commit-runner supports go
2022-11-07 17:35:27 +00:00
Iain Sproat 4ce14be96c Bump go to 1.19 2022-11-07 17:34:19 +00:00
Iain Sproat 2c0628507c ci(pre-commit): Adds pre-commit script to verify Dockerfile & Go 2022-11-07 17:31:34 +00:00
Ben Cox 89ef841a7e Merge pull request #31 from akshtshrma24/fixParser
Account for discord webhook IDs with length 19
2022-08-12 17:15:22 +01:00
akshtshrma24 16dcdf656d fixed parser 2022-08-06 23:10:10 -07:00
Ben Cox ceceb475c7 Add LICENCE file
Closes #25
2021-09-28 14:59:16 +01:00
Ben Cartwright-Cox 2bfb007781 Ensure if listening fails, exit code is not 0
This fixes #23

Since if listening failes on http.ListenAndServe then it would
simply hit the end of main() and thus exit with the status code
of 0, systemd or other task orchestration systems may not restart
on the count that the program did not technically signal it failed.
2021-07-17 20:03:28 +02:00
Ben Cox 3b8af1f970 Merge pull request #19 from karugaru/refactoring
Refactoring main.go
2021-03-10 18:20:54 +00:00
nerves_dev a47f4146f5 Refactoring: Split RawPromAlert into func 2021-03-08 16:19:27 +09:00
nerves_dev 7a32366d51 Refactoring: Split send alert messages into func 2021-03-08 16:13:51 +09:00
nerves_dev 49e3076d4e Refactoring: Split webhook url check into func 2021-03-08 16:08:15 +09:00
nerves_dev b504e7f09c Refactoring: Move param definitions to var section 2021-03-08 16:05:28 +09:00
nerves_dev e8c1bd3569 Refactoring: Color code to hexadecimal notation 2021-03-08 16:03:36 +09:00
Ben Cartwright-Cox df21563f32 Explain better how this fits into the prometheus stack 2021-02-28 18:20:51 +00:00
Ben Cartwright-Cox d9ee4ef581 Detect and notify users when they try to use this _as_ alertman
Since people keep doing it.

See: #18
See: #13
See: #14

and a handful of discord DM's
2021-02-28 18:10:53 +00:00