Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
prometheus-alertmanager
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
infra
ansible
roles
prometheus-alertmanager
Commits
60bb8976
Verified
Commit
60bb8976
authored
3 years ago
by
psy
Browse files
Options
Downloads
Patches
Plain Diff
add author icon
parent
a2a6a989
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
templates/rocketchat-bot.py.j2
+19
-0
19 additions, 0 deletions
templates/rocketchat-bot.py.j2
with
19 additions
and
0 deletions
templates/rocketchat-bot.py.j2
+
19
−
0
View file @
60bb8976
...
...
@@ -21,6 +21,24 @@ icons = {
'
resolved
'
:
'
:white_check_mark:
'
}
'''
Example message:
{
"
text
"
:
"
Example message
"
,
"
attachments
"
: [
{
"
title
"
:
"
Rocket.Chat
"
,
"
title_link
"
:
"
https://rocket.chat
"
,
"
text
"
:
"
Rocket.Chat, the best open source chat
"
,
"
image_url
"
:
"
/images/integration-attachment-example.png
"
,
"
color
"
:
"
#764FA5
"
}
]
}
'''
'''
Example attachment:
...
...
@@ -147,6 +165,7 @@ def send_alert_message(channel, alert):
"
message_link
"
:
alert
.
get
(
'
generatorURL
'
,
'
#
'
),
# link for timestamp, mandatory to display timestamp
"
collapsed
"
:
True
,
# collapse details by default
"
author_name
"
:
alert
[
'
labels
'
].
get
(
'
instance
'
,
'
unknown
'
),
"
author_icon
"
:
"
https://rocket.cccv.de/emoji-custom/molli.png
"
,
"
title
"
:
alert
[
'
annotations
'
][
'
title
'
],
"
fields
"
:
[{
"
short
"
:
True
,
"
title
"
:
key
,
"
value
"
:
value
}
for
key
,
value
in
alert
[
'
labels
'
].
items
()
if
key
not
in
label_ignore_fields
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment