monitoring: improve solutions formatting, add team information (#14878)

This commit is contained in:
Robert Lin 2020-10-20 13:11:20 +08:00 committed by GitHub
parent 3818d5806d
commit 0b47ecd167
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 572 additions and 292 deletions

File diff suppressed because it is too large Load Diff

View File

@ -23,6 +23,12 @@ This structure is inspired by the [Divio documentation system](https://documenta
You can preview the documentation site at http://localhost:5080 when running Sourcegraph in [local development](../getting-started/index.md) (using `dev/start.sh` or `enterprise/dev/start.sh`). It uses content, templates, and assets from the local disk. There is no caching or background build process, so you'll see all changes reflected immediately after you reload the page in your browser.
You can also run the docsite on its own with the following command:
```sh
./dev/docsite.sh -config doc/docsite.json serve -http=localhost:5080
```
## Linking to documentation in-product
In-product documentation links should point to `/help/PATH` instead of using an absolute URL of the form https://docs.sourcegraph.com/PATH. This ensures they link to the documentation for the current product version. There is a redirect (when using either `<a>` or react-router `<Link>`) from `/help/PATH` to the versioned docs.sourcegraph.com URL (https://docs.sourcegraph.com/@VERSION/PATH).

View File

@ -838,8 +838,10 @@ To learn more about Sourcegraph's alerting, see [our alerting documentation](htt
for _, r := range g.Rows {
for _, o := range r {
fmt.Fprintf(&b, "## %s: %s\n\n", c.Name, o.Name)
fmt.Fprintf(&b, `<p class="subtitle">%s: %s</p>`, o.Owner, o.Description)
fmt.Fprintf(&b, "**Descriptions:**\n")
// Render descriptions of various levels of this alert
fmt.Fprintf(&b, "**Descriptions:**\n\n")
var prometheusAlertNames []string
for _, alert := range []struct {
level string
@ -851,12 +853,13 @@ To learn more about Sourcegraph's alerting, see [our alerting documentation](htt
if alert.threshold.isEmpty() {
continue
}
fmt.Fprintf(&b, "\n- _%s_\n", c.alertDescription(o, alert.threshold))
fmt.Fprintf(&b, "- _%s_\n", c.alertDescription(o, alert.threshold))
prometheusAlertNames = append(prometheusAlertNames,
fmt.Sprintf(" \"%s\"", prometheusAlertName(alert.level, c.Name, o.Name)))
}
fmt.Fprint(&b, "\n")
// Render solutions for dealing with this alert
fmt.Fprintf(&b, "**Possible solutions:**\n\n")
if o.PossibleSolutions != "none" {
possibleSolutions, _ := goMarkdown(o.PossibleSolutions)
@ -867,6 +870,9 @@ To learn more about Sourcegraph's alerting, see [our alerting documentation](htt
fmt.Fprintf(&b, "```json\n%s\n```\n\n", fmt.Sprintf(`"observability.silenceAlerts": [
%s
]`, strings.Join(prometheusAlertNames, ",\n")))
// Render break for readability
fmt.Fprint(&b, "<br />\n")
}
}
}