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

When I notify alert to slack, I want to use this option. #912

Merged
merged 2 commits into from
Jul 25, 2017

Conversation

9to6
Copy link
Contributor

@9to6 9to6 commented Jul 20, 2017

Hi.
Thank you for your effort.

I use Alertmanager with Slack.
When I received messages, I wanna use this option for slack.

link_names

You can check this option what is.

https://api.slack.com/methods/chat.postMessage

I updated some codes a little bit.

Usage

slack_configs: 
   link_names: true

I think this options is so important for alerting.
I think most people want to notify them to their owners when they receive messages on Slack.

Thanks.

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.

Thanks for the PR! I left a question above.

@9to6
Copy link
Contributor Author

9to6 commented Jul 24, 2017

Hi. Where is a question?

@stuartnelson3
Copy link
Contributor

Sorry about that! Must have disappeared somehow. Is link_names a string or a bool? From the documentation it looks like it might be a bool?

@9to6
Copy link
Contributor Author

9to6 commented Jul 24, 2017

image
This option's default value is false.
When I use this option, I can input value, number 0 or 1, boolean true or false,
but when I test this option, It cannot allow "false", type is String
When this option set the value, string value "false", I think this option is regarded set True.

@stuartnelson3
Copy link
Contributor

In that case, can you change the type to boolean? It probably interprets any string value as truthy.

@9to6
Copy link
Contributor Author

9to6 commented Jul 24, 2017

I changed type to bool.
But I included invalid commit log inadvertently.

@mxinden
Copy link
Member

mxinden commented Jul 24, 2017

@9to6 Thank you very much for your contribution! Can you create a new branch right off of master and cherry-pick your two commits onto it?

Something along the lines of: (No guarantee, please backup your changes before)

git checkout master
git pull upstream master
git checkout -b slack_mention2
git cherry-pick fc2ab29b6dee17f7612958345c1d22e5d311eaab
git cherry-pick 18041521610b56f6f4eed39024d56a27ec1c967b
git push <your github repo alias> slack_mention2:slack_mention -f

@9to6
Copy link
Contributor Author

9to6 commented Jul 25, 2017

@mxinden Thank you for describing detailed.
I applied that.

@mxinden
Copy link
Member

mxinden commented Jul 25, 2017

@9to6 Thanks for keeping the history clean. @stuartnelson3 Feel free to merge if you have no objections.

@stuartnelson3 stuartnelson3 merged commit e1b2bfe into prometheus:master Jul 25, 2017
iksaif pushed a commit to iksaif/alertmanager that referenced this pull request Sep 15, 2017
)

* add link_names attribute to slack notifier

* changed type of slack option `link_names` to boolean
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