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

Add Slack field configuration documentation #1002

Closed
wants to merge 1 commit into from

Conversation

taharah
Copy link

@taharah taharah commented Apr 14, 2018

Adds documentation on how to configure Slack fields, which were added to the Alertmanager as part of PR #1135.

@taharah taharah force-pushed the add-slack-fields branch 4 times, most recently from 4b32b94 to 18cec9e Compare April 15, 2018 20:36
Signed-off-by: Trevor Wood <Trevor.G.Wood@gmail.com>
@@ -454,6 +454,23 @@ channel: <tmpl_string>
[ text: <tmpl_string> | default = '{{ template "slack.default.text" . }}' ]
[ fallback: <tmpl_string> | default = '{{ template "slack.default.fallback" . }}' ]

# An optional flag indicating whether the value(s) of all fields defined
Copy link
Contributor

Choose a reason for hiding this comment

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

Keep the style consistent with what's above.

# An optional list of key/value pairs to provide further details about the incident.
# The key/value pairs contained within it will be displayed in a table inside the
# message attachment.
[ fields:
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not the structure that is defined in the code.

Copy link
Author

@taharah taharah Apr 16, 2018

Choose a reason for hiding this comment

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

Not quite sure what you mean here. The way the code reads is a little misleading since it looks like it's looping over a map at first glance [1], but the structure is definitely a list of key/value pairs albeit very specific, i.e., needs to include both the title and value for each field defined. Thus, do you mean that the description in the preceding comment of the structure is inaccurate and needs to be more specific?

I've tested and used the following configuration for defining two different fields:

fields:
- title: 'severity'
  value: '{{ .GroupLabels.severity }}'
- title: 'status'
  value: '{{ .Status }}'

Copy link
Contributor

Choose a reason for hiding this comment

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

The code allows for any field to be supplied, not just title and value.

Copy link
Author

Choose a reason for hiding this comment

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

Any number of fields can be defined, but it needs both the title [1] and value [2] defined for each field and then inherits the short parameter as a global setting for all fields [3, 4]. This is the required structure for fields as per the Slack documentation [5].

Copy link
Contributor

Choose a reason for hiding this comment

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

That is still not what is implemented in the alertmanager. I think you need to fix the code.

@taharah
Copy link
Author

taharah commented Jul 9, 2019

Already resolved by #1025.

@taharah taharah closed this Jul 9, 2019
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.

2 participants