File tree Expand file tree Collapse file tree 4 files changed +15
-6
lines changed
Expand file tree Collapse file tree 4 files changed +15
-6
lines changed Original file line number Diff line number Diff line change 11FROM golang:1.11.3-alpine3.8 AS build
2- COPY . /go/src/app
2+ COPY . /go/src/github.com/jpweber/cole
33
4- WORKDIR /go/src/app
4+ WORKDIR /go/src/github.com/jpweber/cole
55RUN apk --update upgrade && \
66 apk add ca-certificates && \
77 update-ca-certificates && \
@@ -15,5 +15,5 @@ RUN apk --update upgrade && \
1515 apk add ca-certificates && \
1616 update-ca-certificates && \
1717 rm -rf /var/cache/apk/*
18- COPY --from=build /go/src/app /app /cole
18+ COPY --from=build /go/src/github.com/jpweber/cole /app /cole
1919CMD ["/cole" ]
Original file line number Diff line number Diff line change @@ -66,6 +66,9 @@ There is a forthcoming blog post on [jpweber.io](http://jpweber.io/blog
6666# Interval = 10
6767# HTTPEndpoint = "https://hooks.slack.com/services/..."
6868# HTTPMethod = "POST"
69+ # SlackChannel = "#general"
70+ # SlackUsername = "Cole - DeadManSwitch Monitor"
71+ # SlackIcon = ":monkey_face : "
6972
7073
7174# PagerDuty
@@ -83,6 +86,9 @@ PDIntegrationKey = "5353fb993888441811111111111"
8386* `HTTP_METHOD`
8487* `EMAIL_ADDR`
8588* `PD_KEY`
89+ * `SLACK_CHANNEL`
90+ * `SLACK_USERNAME`
91+ * `SLACK_ICON`
8692
8793## Example Prometheus Alert Manager config
8894
Original file line number Diff line number Diff line change @@ -14,6 +14,9 @@ type Conf struct {
1414 HTTPMethod string `env:"HTTP_METHOD" envDefault:"POST"`
1515 EmailAddress string `env:"EMAIL_ADDR"`
1616 PDIntegrationKey string `env:"PD_KEY"`
17+ SlackChannel string `env:"SLACK_CHANNEL" envDefault:"#general"`
18+ SlackUsername string `env:"SLACK_USERNAME" envDefault:"Cole - DeadManSwitch Monitor"`
19+ SlackIcon string `env:"SLACK_ICON" envDefault:":monkey_face:"`
1720}
1821
1922// Reads info from config file
Original file line number Diff line number Diff line change @@ -79,9 +79,9 @@ func (n *NotificationSet) slack() {
7979 log .Println ("slack method" )
8080 payload := slack.Payload {
8181 Text : "Missed DeadManSwitch Alert - " + n .Message .CommonAnnotations ["message" ],
82- Username : "Cole - DeadManSwitch Monitor" ,
83- Channel : "#general" ,
84- IconEmoji : ":monkey_face:" ,
82+ Username : n . Config . SlackUsername ,
83+ Channel : n . Config . SlackChannel ,
84+ IconEmoji : n . Config . SlackIcon ,
8585 }
8686 jsonBody , err := json .Marshal (payload )
8787 if err != nil {
You can’t perform that action at this time.
0 commit comments