[GH-ISSUE #463] RocketChat Integration #347

Closed
opened 2026-02-25 23:42:07 +03:00 by kerem · 14 comments
Owner

Originally created by @scornet256 on GitHub (Dec 26, 2020).
Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/463

I'm using the Mattermost integration with my RocketChat instance, which works perfectly.
Just wanted to let you or others know.

Originally created by @scornet256 on GitHub (Dec 26, 2020). Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/463 I'm using the Mattermost integration with my RocketChat instance, which works perfectly. Just wanted to let you or others know.
kerem 2026-02-25 23:42:07 +03:00
Author
Owner

@fbartels commented on GitHub (Dec 27, 2020):

I can confirm this

<!-- gh-comment-id:751470077 --> @fbartels commented on GitHub (Dec 27, 2020): I can confirm this
Author
Owner

@cuu508 commented on GitHub (Dec 28, 2020):

Thanks for the hint!

The Mattermost integration currently uses the exact same notification JSON template as Slack. We still list it as a separate integration, so it can have its own specific setup instructions, and also so that we can split the notification templates in the future if need be.

It would be similar with RocketChat – ideally we'd still want a separate integration with its own setup instructions, even if the JSON template is initially the same.

Also something I must keep in mind: when tweaking the Slack template, I should test Mattermost & RocketChat too!

<!-- gh-comment-id:751669416 --> @cuu508 commented on GitHub (Dec 28, 2020): Thanks for the hint! The Mattermost integration currently uses the exact same notification JSON template as Slack. We still list it as a separate integration, so it can have its own specific setup instructions, and also so that we can split the notification templates in the future if need be. It would be similar with RocketChat – ideally we'd still want a separate integration with its own setup instructions, even if the JSON template is initially the same. Also something I must keep in mind: when tweaking the Slack template, I should test Mattermost & RocketChat too!
Author
Owner

@Dr-Shadow commented on GitHub (May 22, 2023):

#785 is now adding a body in the message for the mattermost integration which is not correctly supported when this integration is used with RocketChat.

The Slack integration has the same problem if used directly in RocketChat.

So, it seems the JSON template starts to need some tweaking

Example :

image

<!-- gh-comment-id:1557164901 --> @Dr-Shadow commented on GitHub (May 22, 2023): #785 is now adding a body in the message for the mattermost integration which is not correctly supported when this integration is used with RocketChat. The Slack integration has the same problem if used directly in RocketChat. So, it seems the JSON template starts to need some tweaking Example : ![image](https://github.com/healthchecks/healthchecks/assets/5308086/4ef8486a-1a32-4943-81dc-588f8386edc3)
Author
Owner

@cuu508 commented on GitHub (May 30, 2023):

I tried a few things but so far I haven't figured out a syntax that would work with Rocket.Chat. Multi-line pre-formatted text works in normal messages, and in the text field in message attachments, but not inside fields.

What I can do for now is add a Rocket.Chat integration which posts the same payload as Mattermost, but exclude the last ping body field. Instead of showing badly formatted Last Ping Body, the notifications would then show no Last Ping Body.

<!-- gh-comment-id:1567987447 --> @cuu508 commented on GitHub (May 30, 2023): I tried a few things but so far I haven't figured out a syntax that would work with Rocket.Chat. Multi-line pre-formatted text works in normal messages, and in the `text` field in message attachments, [but not inside `fields`](https://github.com/RocketChat/Rocket.Chat/issues/9625#issuecomment-1567941216). What I can do for now is add a Rocket.Chat integration which posts the same payload as Mattermost, but exclude the last ping body field. Instead of showing badly formatted Last Ping Body, the notifications would then show no Last Ping Body.
Author
Owner

@cuu508 commented on GitHub (May 30, 2023):

One idea I had was to add a second attachment, and put last ping body in its text field:

image

But this approach has problems too:

  • the red left border has a gap between the attachments
  • the preformatted block is given limited width and so still doesn't look good
<!-- gh-comment-id:1568248277 --> @cuu508 commented on GitHub (May 30, 2023): One idea I had was to add a second attachment, and put last ping body in its `text` field: ![image](https://github.com/healthchecks/healthchecks/assets/661859/c62c5416-9263-4ef9-8ce9-d9beccf647ab) But this approach has problems too: * the red left border has a gap between the attachments * the preformatted block is given limited width and so still doesn't look good
Author
Owner

@Dr-Shadow commented on GitHub (May 30, 2023):

I'm getting this display because I didn't want to spend to much time around the attachment blocks.
I used an integration script to rewrite the json body received by rocket chat
IMG_20230530_135023
EDIT : so i believe just putting the body in the text section 'should' be fine but that's only my point of view

<!-- gh-comment-id:1568299892 --> @Dr-Shadow commented on GitHub (May 30, 2023): I'm getting this display because I didn't want to spend to much time around the attachment blocks. I used an integration script to rewrite the json body received by rocket chat ![IMG_20230530_135023](https://github.com/healthchecks/healthchecks/assets/5308086/13bacbaa-3c8d-41dc-8170-5e55cd1669c1) EDIT : so i believe just putting the body in the text section 'should' be fine but that's only my point of view
Author
Owner

@cuu508 commented on GitHub (May 30, 2023):

Yes, putting it in the text field (outside the attachments) works. We could also post it as a separate message, so it comes after the check details, not before:

image

<!-- gh-comment-id:1568311383 --> @cuu508 commented on GitHub (May 30, 2023): Yes, putting it in the text field (outside the attachments) works. We could also post it as a separate message, so it comes after the check details, not before: ![image](https://github.com/healthchecks/healthchecks/assets/661859/71acc458-bdb0-49a4-b94c-cfcb850c2d6a)
Author
Owner

@Dr-Shadow commented on GitHub (May 30, 2023):

I believe it would be better to use only 1 message for the entire alert. I'm fine with the body before the attachment

<!-- gh-comment-id:1568337837 --> @Dr-Shadow commented on GitHub (May 30, 2023): I believe it would be better to use only 1 message for the entire alert. I'm fine with the body before the attachment
Author
Owner

@cuu508 commented on GitHub (May 30, 2023):

Yep, keeping it in a single message would be better.
I'm not happy with putting the last ping body before the check details. The most important information in the alert is: what check changed state? What is its new state? What is its schedule and how long ago was the last ping? These bits should come first.

Another idea would be to show only a very short excerpt of the last ping body, plus a link to full details:

image

<!-- gh-comment-id:1568423383 --> @cuu508 commented on GitHub (May 30, 2023): Yep, keeping it in a single message would be better. I'm not happy with putting the last ping body before the check details. The most important information in the alert is: what check changed state? What is its new state? What is its schedule and how long ago was the last ping? These bits should come first. Another idea would be to show only a very short excerpt of the last ping body, plus a link to full details: ![image](https://github.com/healthchecks/healthchecks/assets/661859/228a60b0-4d5e-456c-bd4d-181b896ce02d)
Author
Owner

@Dr-Shadow commented on GitHub (Jun 1, 2023):

You're right but our people at our company do not use the healtchecks website so they don't have an account on it :/

It would be a good idea to include a body the "test" hook from the integrations (especially mattermost and slack right now) so I can dig a bit further in the diagnosis as well.

<!-- gh-comment-id:1572661473 --> @Dr-Shadow commented on GitHub (Jun 1, 2023): You're right but our people at our company do not use the healtchecks website so they don't have an account on it :/ It would be a good idea to include a body the "test" hook from the integrations (especially mattermost and slack right now) so I can dig a bit further in the diagnosis as well.
Author
Owner

@cuu508 commented on GitHub (Jun 2, 2023):

You're right but our people at our company do not use the healtchecks website so they don't have an account on it :/

One possible solution is to invite them into the project. When inviting team members you can also set the access level to read-only.

You can also set up email integrations for them, email notifications do contain the last ping body (well, first 10'000 bytes of it).

It would be a good idea to include a body the "test" hook from the integrations (especially mattermost and slack right now) so I can dig a bit further in the diagnosis as well.

Yep, we could do that. Would you be testing how notifications look in different chat platforms, to decide which chat platform to use?

<!-- gh-comment-id:1574005262 --> @cuu508 commented on GitHub (Jun 2, 2023): > You're right but our people at our company do not use the healtchecks website so they don't have an account on it :/ One possible solution is to invite them into the project. When inviting team members you can also set the access level to read-only. You can also set up email integrations for them, email notifications do contain the last ping body (well, first 10'000 bytes of it). > It would be a good idea to include a body the "test" hook from the integrations (especially mattermost and slack right now) so I can dig a bit further in the diagnosis as well. Yep, we could do that. Would you be testing how notifications look in different chat platforms, to decide which chat platform to use?
Author
Owner

@Dr-Shadow commented on GitHub (Jun 2, 2023):

You can also set up email integrations for them, email notifications do contain the last ping body (well, first 10'000 bytes of it).

Yes, I am aware of it. I am already truncating my submitted log to the healthchecks api so that I only include the last 10'000 bytes

Yep, we could do that. Would you be testing how notifications look in different chat platforms, to decide which chat platform to use?

Yes I was already planning to do that once I come back from my holiday leave next week :)

<!-- gh-comment-id:1574135787 --> @Dr-Shadow commented on GitHub (Jun 2, 2023): > You can also set up email integrations for them, email notifications do contain the last ping body (well, first 10'000 bytes of it). Yes, I am aware of it. I am already truncating my submitted log to the healthchecks api so that I only include the last 10'000 bytes > Yep, we could do that. Would you be testing how notifications look in different chat platforms, to decide which chat platform to use? Yes I was already planning to do that once I come back from my holiday leave next week :)
Author
Owner

@cuu508 commented on GitHub (Jun 3, 2023):

I updated the notification template to show the last ping body size in bytes, and a link to view the full body:

image

When or if Rocket.Chat improves the support for showing preformatted text, I'm happy to adjust the notification template.

<!-- gh-comment-id:1574731018 --> @cuu508 commented on GitHub (Jun 3, 2023): I updated the notification template to show the last ping body size in bytes, and a link to view the full body: ![image](https://github.com/healthchecks/healthchecks/assets/661859/92ec061b-d8fe-4029-9d95-bf81bfa3afa7) When or if Rocket.Chat improves the support for showing preformatted text, I'm happy to adjust the notification template.
Author
Owner

@cuu508 commented on GitHub (Jun 5, 2023):

The initial version of the Rocket.Chat integration is ready for business, and is also deployed to the hosted service at https://healthchecks.io.

<!-- gh-comment-id:1576146035 --> @cuu508 commented on GitHub (Jun 5, 2023): The initial version of the Rocket.Chat integration is ready for business, and is also deployed to the hosted service at https://healthchecks.io.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/healthchecks#347
No description provided.