-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Split the notify package into sub packages #1929
Split the notify package into sub packages #1929
Conversation
Instead of keeping all notifiers in the notify package, it splits them into individual sub-packages. This improves readability and maintainability of the code. Signed-off-by: Simon Pasquier <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am a fan of splitting these up into separate packages. Thanks for the pull request!
@@ -92,6 +101,54 @@ func instrumentHandler(handlerName string, handler http.HandlerFunc) http.Handle | |||
|
|||
const defaultClusterAddr = "0.0.0.0:9094" | |||
|
|||
// buildReceiverIntegrations builds a list of integration notifiers off of a | |||
// receiver config. | |||
func buildReceiverIntegrations(nc *config.Receiver, tmpl *template.Template, logger log.Logger) ([]notify.Integration, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be inside the github.com/prometheus/alertmanager/notify
package?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Depending on @simonpasquier's reasoning, I could understand it being moved here. It seems like this is a bunch of imperative code using the notify package components, so it's kind of the glue tying together a library? 🤷♂️, will wait to see what he has to say.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw no concrete reason to keep it in github.com/prometheus/alertmanager/notify
as it is the glue between configuration and notifiers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Signed-off-by: Simon Pasquier <[email protected]>
38d383d
to
5f881d6
Compare
command: make | ||
environment: | ||
# Run garbage collection more aggresively to avoid getting OOMed. | ||
GOGC: "20" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am I right that CircleCI gives us an 8gb machine? https://circleci.com/docs/2.0/executor-types/
I am surprised that we are being OOMed in that case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No we got 4GB because we use the Docker executor with the free plan. We could use a machine executor but it takes more time to start. IMO we need to ask the CNCF for a paid account that would allow to use bigger resources. I can bring it up during our next sync meeting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm surprised we even hit 4gb, to be honest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
webhook.New()
, email.New()
, pagerduty.New()
, brings tears of joy to my eyes..
I'm happy once the tests are green.
Instead of keeping all notifiers in the notify package, it splits them into individual sub-packages. This improves readability and maintainability of the code.
Relates to #1400 and #1517.