Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MM-55630: Generate a new dashboard with enabled coordinator metrics #694

Merged
merged 7 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions config/coordinator.sample.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,55 +14,63 @@
"Queries": [
{
"Description": "Percentage of HTTP 5xx server errors",
"Legend": "Percent",
"Query": "(sum(rate(mattermost_api_time_count{status_code=~\"5..\"}[1m]))/sum(rate(mattermost_api_time_count[1m])))*100",
"Threshold": 0.025,
"MinIntervalSec": 60,
"Alert": true
},
{
"Description": "Average client request duration",
"Legend": "Avg duration (s)",
"Query": "sum(rate(loadtest_http_request_time_sum[1m]))/sum(rate(loadtest_http_request_time_count[1m]))",
"Threshold": 0.1,
"MinIntervalSec": 60,
"Alert": true
},
{
"Description": "99th percentile of client request duration",
"Legend": "P99 duration (s)",
"Query": "histogram_quantile(0.99, sum(rate(loadtest_http_request_time_bucket[1m])) by (le))",
"Threshold": 2.0,
"MinIntervalSec": 60,
"Alert": true
},
{
"Description": "Percentage of HTTP 5xx client errors",
"Legend": "Percent",
"Query": "(sum(rate(loadtest_http_errors_total{status_code=~\"5..\"}[1m]))/sum(rate(loadtest_http_request_time_count[1m])))*100",
"Threshold": 0.025,
"MinIntervalSec": 60,
"Alert": true
},
{
"Description": "Percentage of client timeouts",
"Legend": "Percent",
"Query": "(sum(rate(loadtest_http_timeouts_total[1m]))/sum(rate(loadtest_http_request_time_count[1m]))) * 100",
"Threshold": 0.025,
"MinIntervalSec": 60,
"Alert": true
},
{
"Description": "CPU utilization",
"Description": "CPU utilization - Average of app nodes",
"Legend": "Percent",
"Query": "100 - 100 * (avg(irate(node_cpu_seconds_total{instance=~\"app.*\",mode=\"idle\"}[5m])))",
"Threshold": 85,
"MinIntervalSec": 60,
"Alert": true
},
{
"Description": "Memory utilization",
"Description": "Memory utilization - Average of app nodes",
"Legend": "Percent",
"Query": "100 - 100 * avg(node_memory_MemAvailable_bytes{instance=~\"app.*\"} / node_memory_MemTotal_bytes{instance=~\"app.*\"})",
"Threshold": 85,
"MinIntervalSec": 60,
"Alert": true
},
{
"Description": "Percentage of TCP timeouts in the proxy node",
"Legend": "Percent",
"Query": "100 * rate(node_netstat_TcpExt_TCPTimeouts{instance=~\"proxy:9100\"}[1m]) / (rate(node_netstat_TcpExt_TCPTimeouts{instance=~\"proxy:9100\"}[1m]) + node_netstat_Tcp_CurrEstab{instance=~\"proxy:9100\"})",
"Threshold": 0.2,
"MinIntervalSec": 60,
Expand All @@ -71,6 +79,7 @@

{
"Description": "Percentage of TCP timeouts in the app nodes",
"Legend": "Percent",
"Query": "100 * avg(rate(node_netstat_TcpExt_TCPTimeouts{instance=~\"app.*\"}[1m])) / (avg(rate(node_netstat_TcpExt_TCPTimeouts{instance=~\"app.*\"}[1m])) + avg(node_netstat_Tcp_CurrEstab{instance=~\"app.*\"}))",
"Threshold": 3.0,
"MinIntervalSec": 60,
Expand Down
3 changes: 3 additions & 0 deletions coordinator/performance/prometheus/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ type Configuration struct {
type Query struct {
// The description for the query.
Description string `validate:"notempty"`
// An optional string for populating the legend of this query's panel
// in the Grafana dashboard containing all coordinator metrics
Legend string
// The PromQL query to be run.
Query string `validate:"notempty"`
// The value over which the performance monitor will fire an alert
Expand Down
55 changes: 39 additions & 16 deletions deployment/terraform/assets/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

143 changes: 143 additions & 0 deletions deployment/terraform/assets/coordinator_dashboard_tmpl.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 5,
"links": [],
"liveNow": false,
"panels": [
{{range $idx, $panel := .Panels}}
{{if $idx}},{{end}}{{/* Prepend each panel with a comma except for the first one */}}
{
"datasource": {
"type": "prometheus",
"uid": "P207FEC8D12DA302B"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "dashed"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": {{$panel.Threshold}}
}
]
}
},
"overrides": []
},
"gridPos": {
"h": {{$panel.Height}},
"w": {{$panel.Width}},
"x": {{$panel.PosX}},
"y": {{$panel.PosY}}
},
"id": {{$panel.Id}},
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "P207FEC8D12DA302B"
},
"editorMode": "code",
"expr": "{{$panel.Query}}",
"instant": false,
"legendFormat": "{{$panel.Legend}}",
"range": true,
"refId": "A"
}
],
"title": "{{$panel.Title}}",
"type": "timeseries"
}
{{end}}
],
"refresh": "10s",
"schemaVersion": 39,
"tags": [
"mattermost",
"mattermost-perf"
],
"templating": {
"list": []
},
"time": {
"from": "now-15m",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "Mattermost Load-Test Coordinator Metrics",
"uid": "ad8e66e9-4558-4543-92d3-7fd2c0a037f7",
"version": 1,
"weekStart": ""
}
1 change: 1 addition & 0 deletions deployment/terraform/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,7 @@ func (t *Terraform) init() error {
assets.RestoreAssets(t.config.TerraformStateDir, "datasource.yaml")
assets.RestoreAssets(t.config.TerraformStateDir, "dashboard.yaml")
assets.RestoreAssets(t.config.TerraformStateDir, "dashboard_data.json")
assets.RestoreAssets(t.config.TerraformStateDir, "coordinator_dashboard_tmpl.json")
assets.RestoreAssets(t.config.TerraformStateDir, "es_dashboard_data.json")

// We lock to make this call safe for concurrent use
Expand Down
Loading
Loading