Commit bf85c3f7 authored by Vitali Tatarintev's avatar Vitali Tatarintev

Don't convert hosts into Markdown links explicitly

Let Markdown auto-linking feature handle that.
parent 0b77441a
......@@ -63,7 +63,7 @@ module Projects
metadata << list_item('full_query', backtick(full_query)) if full_query
metadata << list_item(service.label.humanize, service.value) if service
metadata << list_item(monitoring_tool.label.humanize, monitoring_tool.value) if monitoring_tool
metadata << list_item(hosts.label.humanize, host_links.join(' ')) if hosts
metadata << list_item(hosts.label.humanize, host_links) if hosts
metadata.join(MARKDOWN_LINE_BREAK)
end
......@@ -96,10 +96,6 @@ module Projects
"`#{value}`"
end
def markdown_link(title, url)
"[#{title}](#{url})"
end
GENERIC_ALERT_SUMMARY_ANNOTATIONS.each do |annotation_name|
define_method(annotation_name) do
annotations.find { |a| a.label == annotation_name }
......@@ -107,7 +103,7 @@ module Projects
end
def host_links
Array(hosts.value).map { |host| markdown_link(host, host) }
Array(hosts.value).join(' ')
end
end
end
......
......@@ -116,7 +116,7 @@ describe Projects::Prometheus::AlertPresenter do
**Start time:** #{presenter.starts_at}#{markdown_line_break}
**Service:** service_name#{markdown_line_break}
**Monitoring tool:** monitoring_tool_name#{markdown_line_break}
**Hosts:** [http://localhost:3000](http://localhost:3000) [http://localhost:3001](http://localhost:3001)
**Hosts:** http://localhost:3000 http://localhost:3001
#### Alert Details
......@@ -137,7 +137,7 @@ describe Projects::Prometheus::AlertPresenter do
#### Summary
**Start time:** #{presenter.starts_at}#{markdown_line_break}
**Hosts:** [http://localhost:3000](http://localhost:3000)
**Hosts:** http://localhost:3000
MARKDOWN
)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment