Swatto / promtotwilio

Send text messages for Prometheus alerts using Twilio
MIT License
33 stars 21 forks source link

Add a receiver query argument to override default receiver #3

Closed kchugalinskiy closed 6 years ago

kchugalinskiy commented 6 years ago

We need a way to make phone call to a different people and it depends on prometheus event. I see no motivation to run a separated promtotwilio for each person we should call.

This pull request makes RECEIVER env var optional, adding a receiver query parameter. If none is set, BadRequest should be returned.

Swatto commented 6 years ago

Hi @kchugalinskiy. Thanks for your proposal and it would be a great addition.

Before accepting this PR, could you:

kchugalinskiy commented 6 years ago

Sounds reasonable. I've fulfilled your requirements. Please take a look. Also I've added one error check _, err := jsonparser.ArrayEach() ... log.Warn(err) and removed false comparation here: !ctx.IsPost() instead of ctx.IsPost() == false

Swatto commented 6 years ago

👍