Stackdriver to Slack markdown formatting for links

405 views
Skip to first unread message

Jeff Sisson

unread,
May 22, 2019, 1:29:44 PM5/22/19
to Google Stackdriver Discussion Forum
When you configure documentation for an alert to include markdown that doesn't align with Slack's flavor of markdown, this is passed thru to Slack as plain text. The place where this leads to the most awkwardness is really long links — you can do "[link text](url)" and it will show up correctly in Stackdriver, but it will show up as raw unformatted text in Slack, which makes it hard to read for links to something like GCP/Stackdriver Logging links, which are a million miles long :)

Is there a way to get links like these to show up in Slack in a more formatted way?

Mary Koes

unread,
May 22, 2019, 11:30:50 PM5/22/19
to Jeff Sisson, Rory Petty, Google Stackdriver Discussion Forum
+Rory Petty leads alerting and notifications and may have some thoughts...

On Wed, May 22, 2019 at 1:29 PM Jeff Sisson <jeff....@nytimes.com> wrote:
When you configure documentation for an alert to include markdown that doesn't align with Slack's flavor of markdown, this is passed thru to Slack as plain text. The place where this leads to the most awkwardness is really long links — you can do "[link text](url)" and it will show up correctly in Stackdriver, but it will show up as raw unformatted text in Slack, which makes it hard to read for links to something like GCP/Stackdriver Logging links, which are a million miles long :)

Is there a way to get links like these to show up in Slack in a more formatted way?

--
© 2016 Google Inc. 1600 Amphitheatre Parkway, Mountain View, CA 94043
 
Email preferences: You received this email because you signed up for the Google Stackdriver Discussion Google Group (google-stackdr...@googlegroups.com) to participate in discussions with other members of the GoogleStackdriver community.
---
You received this message because you are subscribed to the Google Groups "Google Stackdriver Discussion Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-stackdriver-d...@googlegroups.com.
To post to this group, send email to google-stackdr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-stackdriver-discussion/dbe4d4c3-4eab-4946-85e8-3020f0220b3d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rory Petty

unread,
May 22, 2019, 11:55:02 PM5/22/19
to Mary Koes, Michael Safyan, Bill Mcelroy, Jeff Sisson, Google Stackdriver Discussion Forum
Slack uses their own flavor of Markdown which is why your links are not resolving. I'm not sure how they format our inbound Markup text, but try this format:
<http://someurl|like this>
See:

+Michael Safyan +Bill Mcelroy to see if we need to set "mrkdwn": true in our JSON to Slack.

Michael Safyan

unread,
May 23, 2019, 12:44:53 PM5/23/19
to Rory Petty, Mary Koes, Bill Mcelroy, Jeff Sisson, Google Stackdriver Discussion Forum
The feedback that the markdown documentation ought to be auto-converted from our version of markdown to the version that Slack supports or that our invocation of Slack ought to preserve the markdown formatting by some other means such as indicating to Slack that the payload is in markdown seems like a reasonable piece of feedback. Thanks for raising this issue, Jeff! In terms of figuring out where to put this on our road map, prioritization, etc. are the workarounds that Rory linked to sufficient for the time being? How pressing would you consider this feature vs other features? Rory, we can follow-up internally regarding implementation specifics and estimates of what this would entail.

Michael Safyan

Senior Software Engineer · Stackdriver Monitoring

6425 Penn Ave 7th Floor; Pittsburgh, PA 15206

http://www.michaelsafyan.com | michae...@google.com


Jeff Sisson

unread,
May 23, 2019, 12:48:33 PM5/23/19
to Michael Safyan, Rory Petty, Mary Koes, Bill Mcelroy, Google Stackdriver Discussion Forum
I was able to use the Slack-compatible link markup (e.g. <url|text>) successfully! So it’s definitely not pressing…kind of just a gotcha for people who mainly consume alerts from Slack.

This is off-topic, but the main reason we’re desperate for these better formatted versions of long links is because log-based metrics don’t pass thru any jump links for the underlying log condition that triggered the error, which means we have to manually put them in the documentation…so if I was making suggestions as to features that would be useful to our team, I’d put that much higher than Slack markdown friendliness :)

Michael Safyan

unread,
May 23, 2019, 12:51:04 PM5/23/19
to Jeff Sisson, Rory Petty, Mary Koes, Bill Mcelroy, Google Stackdriver Discussion Forum
Thanks, that is super, super helpful. We've gotten many requests from customers along the lines of wanting logs to be included in messages triggered from logs-based metrics. Knowing that will definitely help us in figuring out our roadmap. 

Michael Safyan

Senior Software Engineer · Stackdriver Monitoring

6425 Penn Ave 7th Floor; Pittsburgh, PA 15206

http://www.michaelsafyan.com | michae...@google.com


Reply all
Reply to author
Forward
0 new messages