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

Split the notify package into sub packages #1929

Merged
merged 2 commits into from
Jun 19, 2019

Conversation

simonpasquier
Copy link
Member

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.

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]>
Copy link
Member

@mxinden mxinden left a 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) {
Copy link
Member

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?

Copy link
Contributor

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.

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 saw no concrete reason to keep it in github.com/prometheus/alertmanager/notify as it is the glue between configuration and notifiers.

Copy link
Member

Choose a reason for hiding this comment

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

👍

command: make
environment:
# Run garbage collection more aggresively to avoid getting OOMed.
GOGC: "20"
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Contributor

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.

Copy link
Contributor

@stuartnelson3 stuartnelson3 left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants