diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..4a02c90 Binary files /dev/null and b/.DS_Store differ diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f0bdb94 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +enterprise.txt + +volumes \ No newline at end of file diff --git a/README.md b/README.md index 72554c3..a38da21 100644 --- a/README.md +++ b/README.md @@ -1 +1,38 @@ -# CS-Deep-Dive-LDAP-SAML +# README + +This is a docker compose file that contains a working Mattermost with an LDAP server. The LDAP image comes from [rroemhild/docker-test-openldap](https://github.com/rroemhild/docker-test-openldap). + +To start this docker file run the below from the root repo directory + + + +You can access mattermost via `localhost:8065`. + +## Getting Started + +1. Add an enterprise license to this folder with the name `license.txt` + +2. Start the docker containers. This may take a second to download everything. + +``` +docker-compose up -d +``` + +3. You can log access Mattermost at `localhost:8065` + + +## Things to break + +- User left an ldap synced team of their own accord +- new email address, can't sign in +- ID attributes don't match. + + + +## Make key + +```bash + +openssl req -x509 -newkey rsa:4096 -keyout myKey.pem -out cert.pem -days 365 -nodes +openssl pkcs12 -export -out keyStore.p12 -inkey myKey.pem -in cert.pem +``` \ No newline at end of file diff --git a/certs/cert.pem b/certs/cert.pem new file mode 100644 index 0000000..34a4955 --- /dev/null +++ b/certs/cert.pem @@ -0,0 +1,28 @@ +-----BEGIN CERTIFICATE----- +MIIEsDCCApgCCQDevuuaZ0R6dzANBgkqhkiG9w0BAQsFADAaMQswCQYDVQQGEwJV +UzELMAkGA1UECAwCTkMwHhcNMjIwOTI5MDAxMDI1WhcNMjMwOTI5MDAxMDI1WjAa +MQswCQYDVQQGEwJVUzELMAkGA1UECAwCTkMwggIiMA0GCSqGSIb3DQEBAQUAA4IC +DwAwggIKAoICAQCrQWpN8jzbgtWvpi3gKKYZPI8oHQfUN99ydSCDCtxgzEtQHYGn +hPKDMx74u5IGUHztyhPA+NtlFm/qq3IwhlaD0pWwPFuFYYHObK81US55joQh4riX +ouSIKyYrix9HTSrnG8zqrIy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L9EU546YwUTbNT/ePuwuS3 +7yPwTMgBsxPbw6YIt1dtu/Ox6WCNSt+MBo3vGJI9HbSmMfA3J1dEMQYxyPd/eYRg +i5e42+YEntTKEHKt3FyGo790U4zrjujCkA48aBXtYapCpeb2xp9apR8SUIPj0gXP +hcwmpojF+Ou+xyXnHmJx9SEY53jpE9TDK+fjLnf+h1uHzEbKMqAaIgWLlWIzHZ+a +pntjqg== +-----END CERTIFICATE----- diff --git a/certs/keyStore.p12 b/certs/keyStore.p12 new file mode 100644 index 0000000..784b534 Binary files /dev/null and b/certs/keyStore.p12 differ diff --git a/certs/mattermost.crt b/certs/mattermost.crt new file mode 100644 index 0000000..d1be1db --- /dev/null +++ b/certs/mattermost.crt @@ -0,0 +1,87 @@ +Bag Attributes + localKeyID: EF 64 CD 0D 53 DC 8C E1 64 D3 F5 EC 1D 94 15 D0 41 E9 E0 6E +subject=/C=US/ST=NC +issuer=/C=US/ST=NC +-----BEGIN CERTIFICATE----- +MIIEsDCCApgCCQDevuuaZ0R6dzANBgkqhkiG9w0BAQsFADAaMQswCQYDVQQGEwJV +UzELMAkGA1UECAwCTkMwHhcNMjIwOTI5MDAxMDI1WhcNMjMwOTI5MDAxMDI1WjAa +MQswCQYDVQQGEwJVUzELMAkGA1UECAwCTkMwggIiMA0GCSqGSIb3DQEBAQUAA4IC +DwAwggIKAoICAQCrQWpN8jzbgtWvpi3gKKYZPI8oHQfUN99ydSCDCtxgzEtQHYGn +hPKDMx74u5IGUHztyhPA+NtlFm/qq3IwhlaD0pWwPFuFYYHObK81US55joQh4riX +ouSIKyYrix9HTSrnG8zqrIyInBZF7s9mXA/OfIwOvNYqf3N8AwSFucZMflfFyvzF +w41denE7uoWY4L+4/zu37MlWo2mo8NFKNL/dnB2WJzXEvXVaDTD9ng1aVODbJjW2 +j7WTilZZi5+7hFup2yGVcYHAkGkZ+OKhDekuKln/EjCdFP/opxHM6s1JYVe/HHfV +nc/1Ib28fP3oMs0rfJfwR2OJ0wlid1ujRX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aIgWLlWIzHZ+a +pntjqg== +-----END CERTIFICATE----- +Bag Attributes + localKeyID: EF 64 CD 0D 53 DC 8C E1 64 D3 F5 EC 1D 94 15 D0 41 E9 E0 6E +Key Attributes: +-----BEGIN PRIVATE KEY----- +MIIJQQIBADANBgkqhkiG9w0BAQEFAASCCSswggknAgEAAoICAQCrQWpN8jzbgtWv +pi3gKKYZPI8oHQfUN99ydSCDCtxgzEtQHYGnhPKDMx74u5IGUHztyhPA+NtlFm/q +q3IwhlaD0pWwPFuFYYHObK81US55joQh4riXouSIKyYrix9HTSrnG8zqrIyInBZF +7s9mXA/OfIwOvNYqf3N8AwSFucZMflfFyvzFw41denE7uoWY4L+4/zu37MlWo2mo +8NFKNL/dnB2WJzXEvXVaDTD9ng1aVODbJjW2j7WTilZZi5+7hFup2yGVcYHAkGkZ ++OKhDekuKln/EjCdFP/opxHM6s1JYVe/HHfVnc/1Ib28fP3oMs0rfJfwR2OJ0wli +d1ujRXjofZQ5d/RVsxf7PIOn9ErtWwuqIKBJJe1h/hyGsc8hKApR1PsNwkPctNgV +ayqNkCw+gQ1JtGOLIVOe1OwPH2gRHk6tFEDWZtut/uv8u4JCs0ebTdzfc8e/6SFL +vTFZzBO2f/jVS+HU4yjmLhUZSqj3tVnYhQYQxoRhKKsQYtLw67cLVCt1xl+JThaU +IJLQfSbgGKa4X+NKK+lLduw3hER3H8NseP46qhanRJYhaHNkdeGY/QO55Fn4jud0 +SEBezvBMMubHR9ui7g6YWSjmePh0Ef2y1B+Hy/dzaaccwfKar+MftU1cbEcDDpai +wKlb98HuVPouDq3NbVXJpIFoiou6SwIDAQABAoICAHy0nt9xtQU3ybklbqSblRAt +fCV+tlO/9/OV/P3Pq9jFC1akleRRuHL3h+ciV1xHwiE6FJZh4QlEhGzDOdzCBj/p +2dzCpvaCoY6asB9IJWqY7/jo6vhowrexjBMLNNSsCcDPCrIcwh08ZC+6jcaA5XW8 +VhTpR58cvhCg9esW86KCIhJDFTxBgTB/1/LhiSVhC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xCQOg1EigqXR7+7Ac8j9c3RWEYle9HGm +TuDFKIsuFm/7QtYp5tCKDMetnK1SAUDf2zxS5LRwP3njQSuexfXYGSrIjJgWFIb3 +x6HwQnd/hJeig7u6P5zf051OUo6W +-----END PRIVATE KEY----- diff --git a/certs/mattermost.key b/certs/mattermost.key new file mode 100644 index 0000000..0272f83 --- /dev/null +++ b/certs/mattermost.key @@ -0,0 +1,55 @@ +Bag Attributes + localKeyID: EF 64 CD 0D 53 DC 8C E1 64 D3 F5 EC 1D 94 15 D0 41 E9 E0 6E +Key Attributes: +-----BEGIN PRIVATE KEY----- +MIIJQQIBADANBgkqhkiG9w0BAQEFAASCCSswggknAgEAAoICAQCrQWpN8jzbgtWv +pi3gKKYZPI8oHQfUN99ydSCDCtxgzEtQHYGnhPKDMx74u5IGUHztyhPA+NtlFm/q +q3IwhlaD0pWwPFuFYYHObK81US55joQh4riXouSIKyYrix9HTSrnG8zqrIyInBZF +7s9mXA/OfIwOvNYqf3N8AwSFucZMflfFyvzFw41denE7uoWY4L+4/zu37MlWo2mo +8NFKNL/dnB2WJzXEvXVaDTD9ng1aVODbJjW2j7WTilZZi5+7hFup2yGVcYHAkGkZ ++OKhDekuKln/EjCdFP/opxHM6s1JYVe/HHfVnc/1Ib28fP3oMs0rfJfwR2OJ0wli +d1ujRXjofZQ5d/RVsxf7PIOn9ErtWwuqIKBJJe1h/hyGsc8hKApR1PsNwkPctNgV +ayqNkCw+gQ1JtGOLIVOe1OwPH2gRHk6tFEDWZtut/uv8u4JCs0ebTdzfc8e/6SFL +vTFZzBO2f/jVS+HU4yjmLhUZSqj3tVnYhQYQxoRhKKsQYtLw67cLVCt1xl+JThaU +IJLQfSbgGKa4X+NKK+lLduw3hER3H8NseP46qhanRJYhaHNkdeGY/QO55Fn4jud0 +SEBezvBMMubHR9ui7g6YWSjmePh0Ef2y1B+Hy/dzaaccwfKar+MftU1cbEcDDpai +wKlb98HuVPouDq3NbVXJpIFoiou6SwIDAQABAoICAHy0nt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aPsEfowRPctPYGO2u2i1 +QWHRZuimlPFQ/fuX01G1463H/Oqb1jcfzIjAXafPOtnXZyofkF3Uv0OqnUFNGQBx +9K6TR4mZ+4EP8Ah2lxf1QDNSPVUvwA++Af0Mqnq1L4nPb9F7hCm6fpJ/RT1BJr3+ +thHyoZmv0VOgk6sHnsBIlpcI2CKfcAqcxCQOg1EigqXR7+7Ac8j9c3RWEYle9HGm +TuDFKIsuFm/7QtYp5tCKDMetnK1SAUDf2zxS5LRwP3njQSuexfXYGSrIjJgWFIb3 +x6HwQnd/hJeig7u6P5zf051OUo6W +-----END PRIVATE KEY----- diff --git a/certs/myKey.pem b/certs/myKey.pem new file mode 100644 index 0000000..cc22ca6 --- /dev/null +++ b/certs/myKey.pem @@ -0,0 +1,52 @@ +-----BEGIN PRIVATE KEY----- +MIIJQQIBADANBgkqhkiG9w0BAQEFAASCCSswggknAgEAAoICAQCrQWpN8jzbgtWv +pi3gKKYZPI8oHQfUN99ydSCDCtxgzEtQHYGnhPKDMx74u5IGUHztyhPA+NtlFm/q +q3IwhlaD0pWwPFuFYYHObK81US55joQh4riXouSIKyYrix9HTSrnG8zqrIyInBZF +7s9mXA/OfIwOvNYqf3N8AwSFucZMflfFyvzFw41denE7uoWY4L+4/zu37MlWo2mo +8NFKNL/dnB2WJzXEvXVaDTD9ng1aVODbJjW2j7WTilZZi5+7hFup2yGVcYHAkGkZ ++OKhDekuKln/EjCdFP/opxHM6s1JYVe/HHfVnc/1Ib28fP3oMs0rfJfwR2OJ0wli +d1ujRXjofZQ5d/RVsxf7PIOn9ErtWwuqIKBJJe1h/hyGsc8hKApR1PsNwkPctNgV +ayqNkCw+gQ1JtGOLIVOe1OwPH2gRHk6tFEDWZtut/uv8u4JCs0ebTdzfc8e/6SFL +vTFZzBO2f/jVS+HU4yjmLhUZSqj3tVnYhQYQxoRhKKsQYtLw67cLVCt1xl+JThaU +IJLQfSbgGKa4X+NKK+lLduw3hER3H8NseP46qhanRJYhaHNkdeGY/QO55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4B +IQnXNw0oRLd7ZVNXoGvcaAb638a8i7H3xs/WROiov8k/TIYm34XWJ4yd3aFvF8pw +XQKCAQBydFyYSRNSb2nLBh6w7lL6aBjs8ubZ1gU0WWJUaPsEfowRPctPYGO2u2i1 +QWHRZuimlPFQ/fuX01G1463H/Oqb1jcfzIjAXafPOtnXZyofkF3Uv0OqnUFNGQBx +9K6TR4mZ+4EP8Ah2lxf1QDNSPVUvwA++Af0Mqnq1L4nPb9F7hCm6fpJ/RT1BJr3+ +thHyoZmv0VOgk6sHnsBIlpcI2CKfcAqcxCQOg1EigqXR7+7Ac8j9c3RWEYle9HGm +TuDFKIsuFm/7QtYp5tCKDMetnK1SAUDf2zxS5LRwP3njQSuexfXYGSrIjJgWFIb3 +x6HwQnd/hJeig7u6P5zf051OUo6W +-----END PRIVATE KEY----- diff --git a/deep-dive.env b/deep-dive.env new file mode 100644 index 0000000..585718b --- /dev/null +++ b/deep-dive.env @@ -0,0 +1,36 @@ + + +# necessary Mattermost options/variables (see env.example) +MM_SQLSETTINGS_DRIVERNAME=postgres +MM_SQLSETTINGS_DATASOURCE=postgres://mmuser:mmuser_password@postgres:5432/mattermost?sslmode=disable&connect_timeout= +MM_SERVICESETTINGS_LICENSEFILELOCATION=config/license.mattermost-enterprise + +## turning on local mode so we can use mmctl in the startup script +MM_SERVICESETTINGS_ENABLELOCALMODE=true + +## LDAP config settings +MM_LDAPSETTINGS_ENABLE=true +MM_LDAPSETTINGS_ENABLESYNC=true +MM_LDAPSETTINGS_LDAPSERVER=openldap +MM_LDAPSETTINGS_LDAPPORT=10389 +MM_LDAPSETTINGS_BASEDN="dc=planetexpress,dc=com" +MM_LDAPSETTINGS_BINDUSERNAME="cn=admin,dc=planetexpress,dc=com" +MM_LDAPSETTINGS_BINDPASSWORD=GoodNewsEveryone +MM_LDAPSETTINGS_USERFILER=(objectClass=inetOrgPerson) +MM_LDAPSETTINGS_GROUPFILTER=(objectClass=Group) +MM_LDAPSETTINGS_EnableAdminFilter=true +MM_LDAPSETTINGS_AdminFilter="(memberof=cn=admin_staff,ou=people,dc=planetexpress,dc=com)" +MM_LDAPSETTINGS_GROUPDISPLAYNAMEATTRIBUTE=cn +MM_LDAPSETTINGS_GROUPIDATTRIBUTE=dn +MM_LDAPSETTINGS_FIRSTNAMEATTRIBUTE=givenName +MM_LDAPSETTINGS_LASTNAMEATTRIBUTE=sn +MM_LDAPSETTINGS_EmailAttribute=mail +MM_LDAPSETTINGS_UsernameAttribute=uid +MM_LDAPSETTINGS_IdAttribute=uid +MM_LDAPSETTINGS_LoginIdAttribute=uid +MM_LDAPSETTINGS_TRACE=true + +# MM_SamlSettings_IdpMetadataURL="http://keycloak:8080/auth/realms/master/protocol/saml/descriptor" + +MM_LOGSETTINGS_ADVANCEDLOGGINGCONFIG="{\"console-log\":{\"Type\":\"console\",\"Format\":\"json\",\"Levels\":[{\"ID\":10,\"Name\":\"stdlog\",\"Stacktrace\":false},{\"ID\":5,\"Name\":\"debug\",\"Stacktrace\":false},{\"ID\":4,\"Name\":\"info\",\"Stacktrace\":false,\"color\":36},{\"ID\":3,\"Name\":\"warn\",\"Stacktrace\":false,\"color\":33},{\"ID\":2,\"Name\":\"error\",\"Stacktrace\":true,\"color\":31},{\"ID\":1,\"Name\":\"fatal\",\"Stacktrace\":true},{\"ID\":0,\"Name\":\"panic\",\"Stacktrace\":true}],\"Options\":{\"Out\":\"stdout\"},\"MaxQueueSize\":1000},\"file-log\":{\"Type\":\"file\",\"Format\":\"json\",\"Levels\":[{\"ID\":10,\"Name\":\"stdlog\",\"Stacktrace\":false},{\"ID\":5,\"Name\":\"debug\",\"Stacktrace\":false},{\"ID\":4,\"Name\":\"info\",\"Stacktrace\":false},{\"ID\":3,\"Name\":\"warn\",\"Stacktrace\":false},{\"ID\":2,\"Name\":\"error\",\"Stacktrace\":true},{\"ID\":1,\"Name\":\"fatal\",\"Stacktrace\":true},{\"ID\":0,\"Name\":\"panic\",\"Stacktrace\":true}],\"Options\":{\"Compress\":true,\"Filename\":\"logs/traceLogs.json\",\"MaxAgeDays\":15,\"MaxBackups\":3,\"MaxSizeMB\":100},\"MaxQueueSize\":1000}}" + diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..66f4efe --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,98 @@ +version: '3.9' + +services: + postgres: + container_name: deep-dive-postgres + environment: + - POSTGRES_USER=mmuser + - POSTGRES_PASSWORD=mmuser_password + - POSTGRES_DB=mattermost + - LISTEN_ADDRESS="*" + image: postgres:13-alpine + restart: unless-stopped + ports: + - "5432:5432" + security_opt: + - no-new-privileges:true + pids_limit: 100 + read_only: true + tmpfs: + - /tmp + - /var/run/postgresql + volumes: + - ./volumes/db/var/lib/postgresql/data:/var/lib/postgresql/data + healthcheck: + test: pg_isready -U mmuser -d mattermost + interval: 10s + timeout: 3s + retries: 3 + openldap: + container_name: deep-dive-openldap + hostname: openldap + restart: unless-stopped + image: rroemhild/test-openldap:latest + ports: + - "10389:10389" + - "10636:10636" + prometheus: + container_name: deep-dive-prometheus + image: prom/prometheus:latest + restart: always + ports: + - 9090:9090 + volumes: + - ./files/prometheus.yml:/etc/prometheus/prometheus.yml:ro + - ./volumes/prometheus:/prometheus + grafana: + container_name: deep-dive-grafana + image: grafana/grafana:7.5.7 + ports: + - 3000:3000 + restart: unless-stopped + environment: + - GF_SECURITY_ADMIN_USER=admin + - GF_SECURITY_ADMIN_PASSWORD=admin + - GF_USERS_ALLOW_SIGN_UP=false + volumes: + - ./files/grafana/dashboards:/var/lib/grafana/dashboards + - ./files/grafana/provisioning:/etc/grafana/provisioning + - ./volumes/grafana:/var/lib/grafana + mattermost: + container_name: deep-dive-mattermost + env_file: + - deep-dive.env + depends_on: + postgres: + condition: service_healthy + image: mattermost/mattermost-enterprise-edition:release-7.2 + restart: unless-stopped + security_opt: + - no-new-privileges:true + pids_limit: 200 + read_only: false + ports: + - "8065:8065" + - "8067:8067" + tmpfs: + - /tmp + volumes: + - ./volumes/app/mattermost/config:/mattermost/config:rw + - ./volumes/app/mattermost/data:/mattermost/data:rw + - ./volumes/app/mattermost/logs:/mattermost/logs:rw + - ./volumes/app/mattermost/plugins:/mattermost/plugins:rw + - ./volumes/app/mattermost/client/plugins:/mattermost/client/plugins:rw + - ./volumes/app/mattermost/bleve-indexes:/mattermost/bleve-indexes:rw + - ./enterprise.txt:/mattermost/config/license.mattermost-enterprise:ro + keycloak: + image: quay.io/keycloak/keycloak:latest + volumes: + - ./volumes/keycloak:/opt/keycloak/data:rw + environment: + - PROXY_ADDRESS_FORWARDING="true" + - KEYCLOAK_ADMIN=admin + - KEYCLOAK_ADMIN_PASSWORD=admin + # - KEYCLOAK_URL=http://localhost:8080/auth + ports: + - 8080:8080 + command: + - start-dev \ No newline at end of file diff --git a/files/.DS_Store b/files/.DS_Store new file mode 100644 index 0000000..f352190 Binary files /dev/null and b/files/.DS_Store differ diff --git a/files/README.md b/files/README.md new file mode 100644 index 0000000..427bd1e --- /dev/null +++ b/files/README.md @@ -0,0 +1,3 @@ +# AdvancedLogging.json + +This is a json example to build the advanced logs for Mattermost. This will include the `stdout` files generated by ldap / sql trace. To use this format to a string and set `LogSettings.AdvancedLogging` or format to a string and use the environment variable `MM_LOGSETTINGS_ADVANCEDLOGGING`. \ No newline at end of file diff --git a/files/advancedLogging.json b/files/advancedLogging.json new file mode 100644 index 0000000..8a15dc7 --- /dev/null +++ b/files/advancedLogging.json @@ -0,0 +1,40 @@ +{ + "console-log": { + "Type": "console", + "Format": "json", + "Levels": [ + {"ID": 10, "Name": "stdlog", "Stacktrace": false}, + {"ID": 5, "Name": "debug", "Stacktrace": false}, + {"ID": 4, "Name": "info", "Stacktrace": false, "color": 36}, + {"ID": 3, "Name": "warn", "Stacktrace": false, "color": 33}, + {"ID": 2, "Name": "error", "Stacktrace": true, "color": 31}, + {"ID": 1, "Name": "fatal", "Stacktrace": true}, + {"ID": 0, "Name": "panic", "Stacktrace": true} + ], + "Options": { + "Out": "stdout" + }, + "MaxQueueSize": 1000 + }, + "file-log": { + "Type": "file", + "Format": "json", + "Levels": [ + {"ID": 10, "Name": "stdlog", "Stacktrace": false}, + {"ID": 5, "Name": "debug", "Stacktrace": false}, + {"ID": 4, "Name": "info", "Stacktrace": false}, + {"ID": 3, "Name": "warn", "Stacktrace": false}, + {"ID": 2, "Name": "error", "Stacktrace": true}, + {"ID": 1, "Name": "fatal", "Stacktrace": true}, + {"ID": 0, "Name": "panic", "Stacktrace": true} + ], + "Options": { + "Compress": true, + "Filename": "traceLogs.json", + "MaxAgeDays": 15, + "MaxBackups": 3, + "MaxSizeMB": 100 + }, + "MaxQueueSize": 1000 + } +} \ No newline at end of file diff --git a/files/grafana/.DS_Store b/files/grafana/.DS_Store new file mode 100644 index 0000000..b2decd5 Binary files /dev/null and b/files/grafana/.DS_Store differ diff --git a/files/grafana/dashboards/bonusMetrics.json b/files/grafana/dashboards/bonusMetrics.json new file mode 100644 index 0000000..33f7493 --- /dev/null +++ b/files/grafana/dashboards/bonusMetrics.json @@ -0,0 +1,1807 @@ +{ + "__inputs": [ + { + "name": "mattermost", + "label": "Prometheus", + "description": "", + "type": "datasource", + "pluginId": "prometheus", + "pluginName": "Prometheus" + } + ], + "__requires": [ + { + "type": "panel", + "id": "graph", + "name": "Graph", + "version": "" + }, + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "4.0.2" + }, + { + "type": "datasource", + "id": "mattermost", + "name": "mattermost", + "version": "1.0.0" + } + ], + "id": null, + "title": "Mattermost Performance Monitoring (Bonus Metrics)", + "tags": [ + "mattermost", + "mattermost-perf" + ], + "style": "dark", + "timezone": "browser", + "editable": true, + "sharedCrosshair": false, + "hideControls": false, + "time": { + "from": "now-6h", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "templating": { + "list": [ + { + "allValue": null, + "current": {}, + "datasource": "mattermost", + "hide": 0, + "includeAll": false, + "label": "server", + "multi": true, + "name": "server", + "options": [], + "query": "label_values(job)", + "refresh": 1, + "regex": "", + "sort": 0, + "tagValuesQuery": null, + "tagsQuery": null, + "type": "query" + } + ] + }, + "annotations": { + "list": [] + }, + "refresh": "30s", + "schemaVersion": 13, + "version": 26, + "links": [], + "gnetId": 2545, + "rows": [ + { + "title": "Dashboard Row", + "panels": [ + { + "aliasColors": {}, + "bars": false, + "datasource": "mattermost", + "editable": true, + "error": false, + "fill": 1, + "id": 7, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 12, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "mattermost_login_logins_total{job=~\"$server\"}/(mattermost_login_logins_total{job=~\"$server\"}+mattermost_login_logins_fail_total{job=~\"$server\"})", + "interval": "5s", + "intervalFactor": 1, + "legendFormat": "{{job}}", + "metric": "mattermost_login_logins_total", + "refId": "A", + "step": 5 + }, + { + "expr": "sum(mattermost_login_logins_total{job=~\"$server\"})/(sum(mattermost_login_logins_total{job=~\"$server\"})+sum(mattermost_login_logins_fail_total{job=~\"$server\"}))", + "interval": "5s", + "intervalFactor": 1, + "legendFormat": "All", + "metric": "mattermost_login_logins_total", + "refId": "B", + "step": 5 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Number of Successful Logins / Number of Login Attempts", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "percentunit", + "label": "Login Success Rate", + "logBase": 1, + "max": "1", + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ] + } + ], + "showTitle": false, + "titleSize": "h6", + "height": "333", + "repeat": null, + "repeatRowId": null, + "repeatIteration": null, + "collapse": false + }, + { + "title": "Dashboard Row", + "panels": [ + { + "aliasColors": {}, + "bars": false, + "datasource": "mattermost", + "editable": true, + "error": false, + "fill": 1, + "id": 8, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 12, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "irate(mattermost_login_logins_total{job=~\"$server\"}[1m])*10", + "interval": "1s", + "intervalFactor": 1, + "legendFormat": "{{job}}", + "metric": "mattermost_login_logins_total", + "refId": "A", + "step": 2 + }, + { + "expr": "sum(irate(mattermost_login_logins_total{job=~\"$server\"}[1m])*10)", + "interval": "1s", + "intervalFactor": 1, + "legendFormat": "Total", + "refId": "B", + "step": 2 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Number of Successful Logins per Second", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": "Count", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ] + } + ], + "showTitle": false, + "titleSize": "h6", + "height": "333", + "repeat": null, + "repeatRowId": null, + "repeatIteration": null, + "collapse": false + }, + { + "title": "Dashboard Row", + "panels": [ + { + "aliasColors": {}, + "bars": false, + "datasource": "mattermost", + "editable": true, + "error": false, + "fill": 1, + "id": 9, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 12, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "irate(mattermost_post_emails_sent_total{job=~\"$server\"}[1m])*10", + "interval": "5s", + "intervalFactor": 1, + "legendFormat": "{{job}}", + "metric": "mattermost_post_broadcasts_total", + "refId": "A", + "step": 5 + }, + { + "expr": "sum(irate(mattermost_post_emails_sent_total{job=~\"$server\"}[1m])*10)", + "interval": "5s", + "intervalFactor": 1, + "legendFormat": "Total", + "metric": "mattermost_post_broadcasts_total", + "refId": "B", + "step": 5 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Number of Emails Sent per Second", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": "Count", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ] + } + ], + "showTitle": false, + "titleSize": "h6", + "height": "333", + "repeat": null, + "repeatRowId": null, + "repeatIteration": null, + "collapse": false + }, + { + "title": "Dashboard Row", + "panels": [ + { + "aliasColors": {}, + "bars": false, + "datasource": "mattermost", + "editable": true, + "error": false, + "fill": 1, + "id": 10, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 12, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "irate(mattermost_post_pushes_sent_total{job=~\"$server\"}[1m])*10", + "interval": "5s", + "intervalFactor": 1, + "legendFormat": "{{job}}", + "refId": "A", + "step": 5 + }, + { + "expr": "sum(irate(mattermost_post_pushes_sent_total{job=~\"$server\"}[1m])*10)", + "interval": "5s", + "intervalFactor": 1, + "legendFormat": "Total", + "refId": "B", + "step": 5 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Number of Mobile Push Notifications Sent per Second", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": "Count", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ] + } + ], + "showTitle": false, + "titleSize": "h6", + "height": "333", + "repeat": null, + "repeatRowId": null, + "repeatIteration": null, + "collapse": false + }, + { + "title": "Dashboard Row", + "panels": [ + { + "aliasColors": {}, + "bars": false, + "datasource": "mattermost", + "editable": true, + "error": false, + "fill": 1, + "id": 11, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 12, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "irate(mattermost_post_file_attachments_total{job=~\"$server\"}[1m])*10", + "interval": "5s", + "intervalFactor": 1, + "legendFormat": "{{job}}", + "metric": "mattermost_post_file_attachments_total", + "refId": "A", + "step": 5 + }, + { + "expr": "sum(irate(mattermost_post_file_attachments_total{job=~\"$server\"}[1m])*10)", + "interval": "5s", + "intervalFactor": 1, + "legendFormat": "Total", + "metric": "mattermost_post_file_attachments_total", + "refId": "B", + "step": 5 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Number of File Attachments per Second", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": "Count", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ] + } + ], + "showTitle": false, + "titleSize": "h6", + "height": "333", + "repeat": null, + "repeatRowId": null, + "repeatIteration": null, + "collapse": false + }, + { + "title": "Dashboard Row", + "panels": [ + { + "aliasColors": {}, + "bars": false, + "datasource": "mattermost", + "editable": true, + "error": false, + "fill": 1, + "id": 12, + "legend": { + "alignAsTable": true, + "avg": false, + "current": false, + "max": true, + "min": false, + "show": true, + "sort": "max", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 12, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "irate(mattermost_websocket_event_total{job=~\"$server\"}[1m])*10", + "interval": "5s", + "intervalFactor": 1, + "legendFormat": "{{type}}", + "metric": "mattermost_websocket_event_total", + "refId": "A", + "step": 5 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Number of Websocket Events per Second", + "tooltip": { + "msResolution": false, + "shared": false, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": "Count", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ] + } + ], + "showTitle": false, + "titleSize": "h6", + "height": "450", + "repeat": null, + "repeatRowId": null, + "repeatIteration": null, + "collapse": false + }, + { + "title": "Dashboard Row", + "panels": [ + { + "aliasColors": {}, + "bars": false, + "datasource": "mattermost", + "editable": true, + "error": false, + "fill": 1, + "id": 13, + "legend": { + "alignAsTable": true, + "avg": false, + "current": false, + "max": true, + "min": false, + "show": true, + "sort": "max", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 12, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "irate(mattermost_websocket_broadcasts_total{job=~\"$server\"}[1m])*10", + "interval": "5s", + "intervalFactor": 1, + "legendFormat": "{{name}}", + "metric": "mattermost_websocket_broadcasts_total", + "refId": "A", + "step": 5 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Number of Websocket Broadcasts per Second", + "tooltip": { + "msResolution": false, + "shared": false, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": "Count", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ] + } + ], + "showTitle": false, + "titleSize": "h6", + "height": "450", + "repeat": null, + "repeatRowId": null, + "repeatIteration": null, + "collapse": false + }, + { + "title": "Dashboard Row", + "panels": [ + { + "aliasColors": {}, + "bars": false, + "datasource": "mattermost", + "editable": true, + "error": false, + "fill": 1, + "id": 17, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 12, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "irate(mattermost_http_requests_total{job=~\"$server\"}[1m])*10", + "interval": "5s", + "intervalFactor": 1, + "legendFormat": "{{job}}", + "metric": "mattermost_http_requests_total", + "refId": "A", + "step": 5 + }, + { + "expr": "sum(irate(mattermost_http_requests_total{job=~\"$server\"}[1m])*10)", + "interval": "5s", + "intervalFactor": 1, + "legendFormat": "Total", + "metric": "mattermost_http_requests_total", + "refId": "B", + "step": 5 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Number of API Requests per Second", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": "Count", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ] + } + ], + "showTitle": false, + "titleSize": "h6", + "height": "333", + "repeat": null, + "repeatRowId": null, + "repeatIteration": null, + "collapse": false + }, + { + "title": "Dashboard Row", + "panels": [ + { + "aliasColors": {}, + "bars": false, + "datasource": "mattermost", + "editable": true, + "error": false, + "fill": 1, + "id": 18, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 12, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "irate(mattermost_cluster_cluster_requests_total{job=~\"$server\"}[1m])*10", + "interval": "5s", + "intervalFactor": 1, + "legendFormat": "{{job}}", + "metric": "mattermost_cluster_cluster_requests_total", + "refId": "A", + "step": 5 + }, + { + "expr": "sum(irate(mattermost_cluster_cluster_requests_total{job=~\"$server\"}[1m])*10)", + "interval": "5s", + "intervalFactor": 1, + "legendFormat": "Total", + "metric": "mattermost_cluster_cluster_requests_total", + "refId": "B", + "step": 5 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Number of Cluster Requests per Second", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": "Count", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ] + } + ], + "showTitle": false, + "titleSize": "h6", + "height": "333", + "repeat": null, + "repeatRowId": null, + "repeatIteration": null, + "collapse": false + }, + { + "title": "Dashboard Row", + "panels": [ + { + "aliasColors": {}, + "bars": false, + "datasource": "mattermost", + "editable": true, + "error": false, + "fill": 1, + "id": 5, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 12, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "go_gc_duration_seconds{job=~\"$server\"}", + "interval": "5s", + "intervalFactor": 1, + "legendFormat": "{{job}}", + "metric": "go_gc_duration_seconds", + "refId": "A", + "step": 5 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Garbage Collection Duration (in seconds)", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": "Seconds", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ] + } + ], + "showTitle": false, + "titleSize": "h6", + "height": "333", + "repeat": null, + "repeatRowId": null, + "repeatIteration": null, + "collapse": false + }, + { + "title": "Dashboard Row", + "panels": [ + { + "aliasColors": {}, + "bars": false, + "datasource": "mattermost", + "editable": true, + "error": false, + "fill": 1, + "id": 6, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 12, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "go_memstats_heap_objects{job=~\"$server\"}", + "interval": "5s", + "intervalFactor": 1, + "legendFormat": "{{job}}", + "metric": "go_memstats_heap_objects", + "refId": "A", + "step": 5 + }, + { + "expr": "sum(go_memstats_heap_objects{job=~\"$server\"})", + "interval": "5s", + "intervalFactor": 1, + "legendFormat": "Total", + "metric": "go_memstats_heap_objects", + "refId": "B", + "step": 5 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Number of Objects on the Heap", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": "Count", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ] + } + ], + "showTitle": false, + "titleSize": "h6", + "height": "333", + "repeat": null, + "repeatRowId": null, + "repeatIteration": null, + "collapse": false + }, + { + "title": "Dashboard Row", + "panels": [ + { + "aliasColors": {}, + "bars": false, + "datasource": "mattermost", + "editable": true, + "error": false, + "fill": 1, + "id": 1, + "legend": { + "alignAsTable": true, + "avg": false, + "current": false, + "max": true, + "min": false, + "show": true, + "sort": "max", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 12, + "stack": false, + "steppedLine": true, + "targets": [ + { + "expr": "mattermost_cache_etag_hit_total{job=~\"$server\"}/(mattermost_cache_etag_miss_total{job=~\"$server\"} + mattermost_cache_etag_hit_total{job=~\"$server\"})", + "interval": "30s", + "intervalFactor": 1, + "legendFormat": "{{route}}", + "metric": "mattermost_cache_etag_hit_total", + "refId": "A", + "step": 30 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Etag Hit Rate", + "tooltip": { + "msResolution": false, + "shared": false, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "percentunit", + "label": "Hit Rate", + "logBase": 1, + "max": "1", + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ] + } + ], + "showTitle": false, + "titleSize": "h6", + "height": "333", + "repeat": null, + "repeatRowId": null, + "repeatIteration": null, + "collapse": false + }, + { + "title": "Dashboard Row", + "panels": [ + { + "aliasColors": {}, + "bars": false, + "datasource": "mattermost", + "editable": true, + "error": false, + "fill": 1, + "id": 2, + "legend": { + "alignAsTable": true, + "avg": false, + "current": false, + "max": true, + "min": false, + "show": true, + "sort": "max", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 12, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "mattermost_cache_mem_hit_total{job=~\"$server\"}/(mattermost_cache_mem_miss_total{job=~\"$server\"} + mattermost_cache_mem_hit_total{job=~\"$server\"})", + "interval": "30s", + "intervalFactor": 1, + "legendFormat": "{{name}}", + "metric": "mattermost_cache_mem_hit_total", + "refId": "A", + "step": 30 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Memory Cache Hit Rate", + "tooltip": { + "msResolution": false, + "shared": false, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "percentunit", + "label": "Hit Rate", + "logBase": 1, + "max": "1", + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ] + } + ], + "showTitle": false, + "titleSize": "h6", + "height": "333", + "repeat": null, + "repeatRowId": null, + "repeatIteration": null, + "collapse": false + }, + { + "title": "Dashboard Row", + "panels": [ + { + "aliasColors": {}, + "bars": true, + "datasource": "mattermost", + "editable": true, + "error": false, + "fill": 1, + "id": 3, + "legend": { + "alignAsTable": true, + "avg": true, + "current": false, + "max": false, + "min": false, + "show": true, + "sort": "avg", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": false, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 12, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "mattermost_cache_etag_hit_total{job=~\"$server\"}/(mattermost_cache_etag_miss_total{job=~\"$server\"} + mattermost_cache_etag_hit_total{job=~\"$server\"})", + "interval": "30s", + "intervalFactor": 1, + "legendFormat": "{{route}}", + "metric": "mattermost_cache_etag_hit_total", + "refId": "A", + "step": 30 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Mean Etag Hit Rate (for each server)", + "tooltip": { + "msResolution": false, + "shared": false, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "series", + "name": null, + "show": true, + "values": [ + "avg" + ] + }, + "yaxes": [ + { + "format": "percentunit", + "label": "Hit Rate", + "logBase": 1, + "max": "1", + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ] + } + ], + "showTitle": false, + "titleSize": "h6", + "height": "333", + "repeat": null, + "repeatRowId": null, + "repeatIteration": null, + "collapse": false + }, + { + "title": "Dashboard Row", + "panels": [ + { + "aliasColors": {}, + "bars": true, + "datasource": "mattermost", + "editable": true, + "error": false, + "fill": 1, + "id": 4, + "legend": { + "alignAsTable": true, + "avg": true, + "current": false, + "max": false, + "min": false, + "show": true, + "sort": "avg", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": false, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 12, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "mattermost_cache_mem_hit_total{job=~\"$server\"}/(mattermost_cache_mem_miss_total{job=~\"$server\"} + mattermost_cache_mem_hit_total{job=~\"$server\"})", + "interval": "30s", + "intervalFactor": 1, + "legendFormat": "{{name}}", + "metric": "mattermost_cache_etag_hit_total", + "refId": "A", + "step": 30 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Mean Memory Cache Hit Rate (for each server)", + "tooltip": { + "msResolution": false, + "shared": false, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "series", + "name": null, + "show": true, + "values": [ + "avg" + ] + }, + "yaxes": [ + { + "format": "percentunit", + "label": "Hit Rate", + "logBase": 1, + "max": "1", + "min": "0", + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ] + } + ], + "showTitle": false, + "titleSize": "h6", + "height": "450", + "repeat": null, + "repeatRowId": null, + "repeatIteration": null, + "collapse": false + }, + { + "title": "Dashboard Row", + "panels": [ + { + "aliasColors": {}, + "bars": false, + "datasource": "mattermost", + "editable": true, + "error": false, + "fill": 1, + "id": 14, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 12, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "mattermost_process_resident_memory_bytes{job=~\"$server\"}/1024/1024", + "interval": "5s", + "intervalFactor": 1, + "legendFormat": "{{job}}", + "metric": "mattermost_process_resident_memory_bytes", + "refId": "A", + "step": 5 + }, + { + "expr": "sum(mattermost_process_resident_memory_bytes{job=~\"$server\"}/1024/1024)", + "interval": "5s", + "intervalFactor": 1, + "legendFormat": "Total", + "metric": "mattermost_process_resident_memory_bytes", + "refId": "B", + "step": 5 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Resident Memory Size (in MB)", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": "MB", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ] + } + ], + "showTitle": false, + "titleSize": "h6", + "height": "333", + "repeat": null, + "repeatRowId": null, + "repeatIteration": null, + "collapse": false + }, + { + "title": "Dashboard Row", + "panels": [ + { + "aliasColors": {}, + "bars": false, + "datasource": "mattermost", + "editable": true, + "error": false, + "fill": 1, + "id": 15, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 12, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "mattermost_process_virtual_memory_bytes{job=~\"$server\"}/1024/1024", + "interval": "5s", + "intervalFactor": 1, + "legendFormat": "{{job}}", + "metric": "mattermost_process_virtual_memory_bytes", + "refId": "A", + "step": 5 + }, + { + "expr": "sum(mattermost_process_virtual_memory_bytes{job=~\"$server\"}/1024/1024)", + "interval": "5s", + "intervalFactor": 1, + "legendFormat": "Total", + "metric": "mattermost_process_virtual_memory_bytes", + "refId": "B", + "step": 5 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Virtual Memory Size (in MB)", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": "MB", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ] + } + ], + "showTitle": false, + "titleSize": "h6", + "height": "333", + "repeat": null, + "repeatRowId": null, + "repeatIteration": null, + "collapse": false + }, + { + "title": "Dashboard Row", + "panels": [ + { + "aliasColors": {}, + "bars": false, + "datasource": "mattermost", + "editable": true, + "error": false, + "fill": 1, + "id": 16, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 12, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "mattermost_process_open_fds{job=~\"$server\"}", + "interval": "5s", + "intervalFactor": 1, + "legendFormat": "{{job}}", + "metric": "mattermost_process_open_fds", + "refId": "A", + "step": 5 + }, + { + "expr": "sum(mattermost_process_open_fds{job=~\"$server\"})", + "interval": "5s", + "intervalFactor": 1, + "legendFormat": "Total", + "metric": "mattermost_process_open_fds", + "refId": "B", + "step": 5 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Number of Open File Descriptors", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": "Count", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ] + } + ], + "showTitle": false, + "titleSize": "h6", + "height": "333", + "repeat": null, + "repeatRowId": null, + "repeatIteration": null, + "collapse": false + } + ], + "description": "Mattermost Performance Monitoring (Bonus Metrics) using Prometheus" +} \ No newline at end of file diff --git a/files/grafana/dashboards/kpiMetrics.json b/files/grafana/dashboards/kpiMetrics.json new file mode 100644 index 0000000..78ce83a --- /dev/null +++ b/files/grafana/dashboards/kpiMetrics.json @@ -0,0 +1,1289 @@ +{ + "__inputs": [ + { + "name": "mattermost", + "label": "Prometheus", + "description": "", + "type": "datasource", + "pluginId": "prometheus", + "pluginName": "Prometheus" + } + ], + "__requires": [ + { + "type": "panel", + "id": "singlestat", + "name": "Singlestat", + "version": "" + }, + { + "type": "panel", + "id": "graph", + "name": "Graph", + "version": "" + }, + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "4.0.2" + }, + { + "type": "datasource", + "id": "mattermost", + "name": "Mattermost", + "version": "1.0.0" + } + ], + "id": null, + "title": "Mattermost Performance KPI Metrics", + "tags": [ + "mattermost", + "mattermost-perf" + ], + "style": "dark", + "timezone": "browser", + "editable": true, + "sharedCrosshair": false, + "hideControls": false, + "time": { + "from": "now-6h", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "templating": { + "list": [ + { + "allValue": null, + "current": {}, + "datasource": "mattermost", + "hide": 0, + "includeAll": false, + "label": "server", + "multi": true, + "name": "server", + "options": [], + "query": "label_values(job)", + "refresh": 1, + "regex": "", + "sort": 0, + "tagValuesQuery": null, + "tagsQuery": null, + "type": "query" + } + ] + }, + "annotations": { + "list": [] + }, + "refresh": "30s", + "schemaVersion": 13, + "version": 32, + "links": [], + "gnetId": 2539, + "rows": [ + { + "title": "Dashboard Row", + "panels": [ + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "rgba(50, 172, 45, 0.97)", + "rgba(237, 129, 40, 0.89)", + "rgba(245, 54, 54, 0.9)" + ], + "datasource": "mattermost", + "editable": true, + "error": false, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": true, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "id": 9, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": " %", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "span": 2, + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "targets": [ + { + "expr": "max(irate(mattermost_process_cpu_seconds_total{job=~\"$server\"}[1m])* 100)", + "interval": "5s", + "intervalFactor": 1, + "legendFormat": "", + "metric": "mattermost_process_cpu_seconds_total", + "refId": "A", + "step": 5 + } + ], + "thresholds": "50,80", + "title": "Max CPU utilization rate (%)", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "datasource": "mattermost", + "editable": true, + "error": false, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "id": 21, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "span": 2, + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "targets": [ + { + "expr": "sum(rate(mattermost_post_total{job=~\"$server\"}[1m])*50)", + "interval": "1m", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A", + "step": 60 + } + ], + "thresholds": "", + "title": "Number of messages / min", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "datasource": "mattermost", + "editable": true, + "error": false, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "id": 20, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "span": 2, + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "targets": [ + { + "expr": "sum(rate(mattermost_http_errors_total{job=~\"$server\"}[1m])*50)", + "interval": "1m", + "intervalFactor": 1, + "refId": "A", + "step": 60 + } + ], + "thresholds": "", + "title": "Number of API errors / min", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "rgba(50, 172, 45, 0.97)", + "rgba(237, 129, 40, 0.89)", + "rgba(245, 54, 54, 0.9)" + ], + "datasource": "mattermost", + "editable": true, + "error": false, + "format": "none", + "gauge": { + "maxValue": 1000, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "id": 13, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "span": 2, + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "targets": [ + { + "expr": "sum(mattermost_http_websockets_total{job=~\"$server\"})", + "interval": "5s", + "intervalFactor": 1, + "refId": "A", + "step": 5 + } + ], + "thresholds": "500, 800", + "title": "Number of connected devices", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "rgba(50, 172, 45, 0.97)", + "rgba(237, 129, 40, 0.89)", + "rgba(245, 54, 54, 0.9)" + ], + "datasource": "mattermost", + "editable": true, + "error": false, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "id": 17, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "span": 2, + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "targets": [ + { + "expr": "sum(mattermost_db_master_connections_total{job=~\"$server\"})", + "interval": "5s", + "intervalFactor": 1, + "refId": "A", + "step": 5 + } + ], + "thresholds": "50, 80", + "title": "Number of master DB conns", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "rgba(50, 172, 45, 0.97)", + "rgba(237, 129, 40, 0.89)", + "rgba(245, 54, 54, 0.9)" + ], + "datasource": "mattermost", + "editable": true, + "error": false, + "format": "none", + "gauge": { + "maxValue": 1000, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "id": 12, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": " MB", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "span": 2, + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false + }, + "targets": [ + { + "expr": "sum(go_memstats_alloc_bytes{job=~\"$server\"})/1024/1024", + "interval": "5s", + "intervalFactor": 1, + "refId": "A", + "step": 5 + } + ], + "thresholds": "500, 800", + "title": "Server memory usage (in MB)", + "type": "singlestat", + "valueFontSize": "80%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + } + ], + "showTitle": false, + "titleSize": "h6", + "height": 143, + "repeat": null, + "repeatRowId": null, + "repeatIteration": null, + "collapse": false + }, + { + "title": "Dashboard Row", + "panels": [ + { + "aliasColors": {}, + "bars": false, + "datasource": "mattermost", + "editable": true, + "error": false, + "fill": 1, + "id": 2, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 6, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "irate(mattermost_post_total{job=~\"$server\"}[1m])*10", + "interval": "5s", + "intervalFactor": 1, + "legendFormat": "{{job}}", + "metric": "mattermost_post_total", + "refId": "A", + "step": 5 + }, + { + "expr": "sum(irate(mattermost_post_total{job=~\"$server\"}[1m])*10)", + "interval": "5s", + "intervalFactor": 1, + "legendFormat": "Total", + "metric": "mattermost_post_total", + "refId": "B", + "step": 5 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Number of Messages per Second", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": "Count", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ] + }, + { + "aliasColors": {}, + "bars": false, + "datasource": "mattermost", + "editable": true, + "error": false, + "fill": 1, + "id": 5, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 6, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "irate(mattermost_http_errors_total{job=~\"$server\"}[1m])*10", + "interval": "5s", + "intervalFactor": 1, + "legendFormat": "{{job}}", + "metric": "mattermost_http_errors_total", + "refId": "A", + "step": 5 + }, + { + "expr": "sum(irate(mattermost_http_errors_total{job=~\"$server\"}[1m])*10)", + "interval": "5s", + "intervalFactor": 1, + "legendFormat": "Total", + "metric": "mattermost_http_errors_total", + "refId": "B", + "step": 5 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Number of API Errors per Second", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": "Count", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ] + } + ], + "showTitle": false, + "titleSize": "h6", + "height": "250", + "repeat": null, + "repeatRowId": null, + "repeatIteration": null, + "collapse": false + }, + { + "title": "Dashboard Row", + "panels": [ + { + "aliasColors": {}, + "bars": false, + "datasource": "mattermost", + "editable": true, + "error": false, + "fill": 1, + "id": 8, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 6, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "1000.0 * rate(mattermost_http_request_duration_seconds_sum{job=~\"$server\"}[1m]) / rate(mattermost_http_request_duration_seconds_count{job=~\"$server\"}[1m])", + "interval": "5s", + "intervalFactor": 1, + "legendFormat": "{{job}}", + "metric": "mattermost_http_request_duration_seconds_sum", + "refId": "A", + "step": 5 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Mean API Request Time (in milliseconds)", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": "Milliseconds (ms)", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ] + }, + { + "aliasColors": {}, + "bars": false, + "datasource": "mattermost", + "editable": true, + "error": false, + "fill": 1, + "id": 19, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 6, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "mattermost_db_master_connections_total{job=~\"$server\"}", + "interval": "5s", + "intervalFactor": 1, + "legendFormat": "{{job}}", + "metric": "mattermost_db_master_connections_total", + "refId": "A", + "step": 5 + }, + { + "expr": "sum(mattermost_db_master_connections_total{job=~\"$server\"})", + "interval": "5s", + "intervalFactor": 1, + "legendFormat": "Total", + "metric": "mattermost_db_master_connections_total", + "refId": "B", + "step": 5 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Number of Connections to Master Database", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": "Count", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ] + } + ], + "showTitle": false, + "titleSize": "h6", + "height": 252, + "repeat": null, + "repeatRowId": null, + "repeatIteration": null, + "collapse": false + }, + { + "title": "Dashboard Row", + "panels": [ + { + "aliasColors": {}, + "bars": false, + "datasource": "mattermost", + "editable": true, + "error": false, + "fill": 1, + "id": 1, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 6, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "1000.0 * rate(mattermost_cluster_cluster_request_duration_seconds_sum{job=~\"$server\"}[1m]) / rate(mattermost_cluster_cluster_request_duration_seconds_count{job=~\"$server\"}[1m])", + "interval": "5s", + "intervalFactor": 1, + "legendFormat": "{{job}}", + "metric": "mattermost_cluster_cluster_request_duration_seconds_sum", + "refId": "A", + "step": 5 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Mean Cluster Request Time (in milliseconds)", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": "Milliseconds (ms)", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ] + }, + { + "aliasColors": {}, + "bars": false, + "datasource": "mattermost", + "editable": true, + "error": false, + "fill": 1, + "id": 23, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 6, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "mattermost_db_read_replica_connections_total{job=~\"$server\"}", + "interval": "5s", + "intervalFactor": 1, + "legendFormat": "{{job}}", + "metric": "mattermost_db_read_replica_connections_total", + "refId": "A", + "step": 5 + }, + { + "expr": "sum(mattermost_db_read_replica_connections_total{job=~\"$server\"})", + "interval": "5s", + "intervalFactor": 1, + "legendFormat": "Total", + "metric": "mattermost_db_read_replica_connections_total", + "refId": "B", + "step": 5 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Number of Connections to Read Replica Databases", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": "Count", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ] + } + ], + "showTitle": false, + "titleSize": "h6", + "height": 250, + "repeat": null, + "repeatRowId": null, + "repeatIteration": null, + "collapse": false + }, + { + "title": "Dashboard Row", + "panels": [ + { + "aliasColors": {}, + "bars": false, + "datasource": "mattermost", + "editable": true, + "error": false, + "fill": 1, + "id": 22, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 6, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "irate(mattermost_process_cpu_seconds_total{job=~\"$server\"}[1m])* 100", + "interval": "5s", + "intervalFactor": 1, + "legendFormat": "{{job}}", + "metric": "mattermost_process_cpu_seconds_total", + "refId": "A", + "step": 5 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "CPU Utilization Rate (%)", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": "Utilization Rate (%)", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ] + }, + { + "aliasColors": {}, + "bars": false, + "datasource": "mattermost", + "editable": true, + "error": false, + "fill": 1, + "id": 18, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 6, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "go_goroutines{job=~\"$server\"}", + "interval": "5s", + "intervalFactor": 1, + "legendFormat": "{{job}}", + "metric": "go_goroutines", + "refId": "A", + "step": 5 + }, + { + "expr": "sum(go_goroutines{job=~\"$server\"})", + "interval": "5s", + "intervalFactor": 1, + "legendFormat": "Total", + "metric": "go_goroutines", + "refId": "B", + "step": 5 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Number of Go Routines", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": "Count", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ] + } + ], + "showTitle": false, + "titleSize": "h6", + "height": 250, + "repeat": null, + "repeatRowId": null, + "repeatIteration": null, + "collapse": false + } + ], + "description": "Mattermost Performance KPI Metrics using Prometheus" +} \ No newline at end of file diff --git a/files/grafana/dashboards/metricsv2.json b/files/grafana/dashboards/metricsv2.json new file mode 100644 index 0000000..39bfc69 --- /dev/null +++ b/files/grafana/dashboards/metricsv2.json @@ -0,0 +1,2263 @@ +{ + "__inputs": [ + { + "name": "mattermost", + "label": "Prometheus", + "description": "", + "type": "datasource", + "pluginId": "prometheus", + "pluginName": "Prometheus" + } + ], + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "7.2.1" + }, + { + "type": "panel", + "id": "graph", + "name": "Graph", + "version": "" + }, + { + "type": "datasource", + "id": "mattermost", + "name": "mattermost", + "version": "1.0.0" + } + ], + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": 15582, + "graphTooltip": 1, + "id": null, + "iteration": 1642574860336, + "links": [], + "panels": [ + { + "collapsed": false, + "datasource": "mattermost", + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 6, + "panels": [], + "title": "Application Metrics", + "type": "row" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "mattermost", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 1 + }, + "hiddenSeries": false, + "id": 12, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.2.1", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "rate(mattermost_http_requests_total{instance=~\"$server\"}[1m])", + "interval": "", + "legendFormat": "{{instance}}", + "refId": "A" + }, + { + "expr": "sum(rate(mattermost_http_requests_total{instance=~\"$server\"}[1m]))", + "interval": "", + "legendFormat": "Total", + "refId": "B" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "HTTP Requests per second", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:1128", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "$$hashKey": "object:1129", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "mattermost", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 1 + }, + "hiddenSeries": false, + "id": 20, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.2.1", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(rate(mattermost_db_store_time_count{instance=~\"$server\"}[5m])) by (instance)", + "interval": "", + "legendFormat": "{{instance}}", + "refId": "A" + }, + { + "expr": "sum(rate(mattermost_db_store_time_count{instance=~\"$server\"}[5m]))", + "interval": "", + "legendFormat": "Total", + "refId": "B" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "DB Calls per second", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:1772", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "$$hashKey": "object:1773", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "mattermost", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 9 + }, + "hiddenSeries": false, + "id": 16, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.2.1", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "histogram_quantile(0.99, sum(rate(mattermost_api_time_bucket{instance=~\"$server\"}[1m])) by (instance,le))", + "interval": "", + "legendFormat": "p99-{{instance}}", + "refId": "A" + }, + { + "expr": "histogram_quantile(0.50, sum(rate(mattermost_api_time_bucket{instance=~\"$server\"}[1m])) by (instance,le))", + "interval": "", + "legendFormat": "p50-{{instance}}", + "refId": "B" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "API Latency", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:1298", + "format": "s", + "label": null, + "logBase": 2, + "max": null, + "min": null, + "show": true + }, + { + "$$hashKey": "object:1299", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "mattermost", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 9 + }, + "hiddenSeries": false, + "id": 18, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.2.1", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "histogram_quantile(0.99, sum(rate(mattermost_db_store_time_bucket{instance=~\"$server\"}[1m])) by (instance,le))", + "interval": "", + "legendFormat": "p99-{{instance}}", + "refId": "A" + }, + { + "expr": "histogram_quantile(0.50, sum(rate(mattermost_db_store_time_bucket{instance=~\"$server\"}[1m])) by (instance,le))", + "interval": "", + "legendFormat": "p50-{{instance}}", + "refId": "B" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Store latency", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:1381", + "format": "s", + "label": null, + "logBase": 2, + "max": null, + "min": null, + "show": true + }, + { + "$$hashKey": "object:1382", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "mattermost", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 17 + }, + "hiddenSeries": false, + "id": 28, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.2.1", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(increase(mattermost_db_store_time_count{instance=~\"$server\",method=~\"$top_db_count\"}[5m])) by (method)", + "interval": "", + "legendFormat": "{{method}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Top 10 DB Calls by Count", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:2313", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "$$hashKey": "object:2314", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "mattermost", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 17 + }, + "hiddenSeries": false, + "id": 30, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.2.1", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(increase(mattermost_api_time_count{instance=~\"$server\",handler=~\"$top_api_count\"}[5m])) by (handler)", + "interval": "", + "legendFormat": "{{handler}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Top 10 API Requests by Count", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:2422", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "$$hashKey": "object:2423", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "mattermost", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 25 + }, + "hiddenSeries": false, + "id": 32, + "legend": { + "alignAsTable": true, + "avg": true, + "current": false, + "max": true, + "min": true, + "rightSide": true, + "show": true, + "sort": "avg", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null as zero", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.2.1", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(increase(mattermost_db_store_time_sum{instance=~\"$server\",method=~\"$top_db_latency\"}[5m])) by (method) / sum(increase(mattermost_db_store_time_count{instance=~\"$server\",method=~\"$top_db_latency\"}[5m])) by (method)", + "interval": "", + "legendFormat": "{{method}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Top 10 DB calls by duration", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:2505", + "format": "s", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "$$hashKey": "object:2506", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "mattermost", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 25 + }, + "hiddenSeries": false, + "id": 34, + "legend": { + "alignAsTable": true, + "avg": true, + "current": false, + "max": true, + "min": true, + "rightSide": true, + "show": true, + "sort": "avg", + "sortDesc": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null as zero", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.2.1", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(increase(mattermost_api_time_sum{instance=~\"$server\",handler=~\"$top_api_latency\"}[5m])) by (handler) / sum(increase(mattermost_api_time_count{instance=~\"$server\",handler=~\"$top_api_latency\"}[5m])) by (handler)", + "interval": "", + "legendFormat": "{{handler}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Top 10 API requests by duration", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:2667", + "format": "s", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "$$hashKey": "object:2668", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "mattermost", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 33 + }, + "hiddenSeries": false, + "id": 24, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null as zero", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.2.1", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "histogram_quantile (\n 0.99,\n sum by (le, instance)(\n rate(mattermost_api_time_bucket{instance=~\"$server\",handler=\"getPostsForChannelAroundLastUnread\"}[5m])\n )\n)", + "interval": "", + "legendFormat": "p99-{{instance}}", + "refId": "A" + }, + { + "expr": "histogram_quantile (\n 0.50,\n sum by (le, instance)(\n rate(mattermost_api_time_bucket{instance=~\"$server\",handler=\"getPostsForChannelAroundLastUnread\"}[5m])\n )\n)", + "interval": "", + "legendFormat": "p50-{{instance}}", + "refId": "B" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Channel Load Duration", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:2118", + "format": "s", + "label": null, + "logBase": 2, + "max": null, + "min": null, + "show": true + }, + { + "$$hashKey": "object:2119", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "mattermost", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 33 + }, + "hiddenSeries": false, + "id": 26, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null as zero", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.2.1", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "histogram_quantile (\n 0.99,\n sum by (le, instance)(\n rate(mattermost_api_time_bucket{instance=~\"$server\",handler=\"createPost\"}[5m])\n )\n)", + "interval": "", + "legendFormat": "p99-{{instance}}", + "refId": "A" + }, + { + "expr": "histogram_quantile (\n 0.50,\n sum by (le, instance)(\n rate(mattermost_api_time_bucket{instance=~\"$server\",handler=\"createPost\"}[5m])\n )\n)", + "interval": "", + "legendFormat": "p50-{{instance}}", + "refId": "B" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "CreatePost duration", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:2216", + "format": "s", + "label": null, + "logBase": 2, + "max": null, + "min": null, + "show": true + }, + { + "$$hashKey": "object:2217", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "mattermost", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 41 + }, + "hiddenSeries": false, + "id": 14, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.2.1", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "mattermost_http_websockets_total{instance=~\"$server\"}", + "interval": "", + "legendFormat": "{{instance}}", + "refId": "A" + }, + { + "expr": "sum(mattermost_http_websockets_total{instance=~\"$server\"})", + "interval": "", + "legendFormat": "Total", + "refId": "B" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Number of connected devices (WebSocket Connections)", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:1215", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "$$hashKey": "object:1216", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "mattermost", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 41 + }, + "hiddenSeries": false, + "id": 22, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.2.1", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(mattermost_db_master_connections_total)", + "interval": "", + "legendFormat": "master", + "refId": "A" + }, + { + "expr": "sum(mattermost_db_read_replica_connections_total)", + "interval": "", + "legendFormat": "replica", + "refId": "B" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "DB Connections", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:1932", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "$$hashKey": "object:1933", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "mattermost", + "description": "This needs to be configured in config.json for it to work", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 49 + }, + "hiddenSeries": false, + "id": 44, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.2.1", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "mattermost_db_replica_lag_time{instance=~\"$server\"}", + "interval": "", + "legendFormat": "{{instance}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Replica Lag", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:3692", + "format": "none", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "$$hashKey": "object:3693", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "collapsed": true, + "datasource": "mattermost", + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 57 + }, + "id": 36, + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "mattermost", + "description": "Lower numbers are better, and zero means \"totally healthy\".", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 2 + }, + "hiddenSeries": false, + "id": 38, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.2.1", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "mattermost_cluster_cluster_health_score{instance=~\"$server\"}", + "interval": "", + "legendFormat": "{{instance}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Cluster Health", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:2865", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "$$hashKey": "object:2866", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "mattermost", + "description": "", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 2 + }, + "hiddenSeries": false, + "id": 40, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.2.1", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "histogram_quantile(0.99, sum(rate(mattermost_cluster_cluster_request_duration_seconds_bucket{instance=~\"$server\"}[5m])) by (le,instance))", + "interval": "", + "legendFormat": "p99-{{instance}}", + "refId": "A" + }, + { + "expr": "histogram_quantile(0.50, sum(rate(mattermost_cluster_cluster_request_duration_seconds_bucket{instance=~\"$server\"}[5m])) by (le,instance))", + "interval": "", + "legendFormat": "p50-{{instance}}", + "refId": "B" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Cluster Request Duration", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:2948", + "format": "s", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "$$hashKey": "object:2949", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "mattermost", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 10 + }, + "hiddenSeries": false, + "id": 42, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.2.1", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "sum(rate(mattermost_cluster_cluster_request_duration_seconds_count{instance=~\"$server\"}[5m])) by (instance)", + "interval": "", + "legendFormat": "{{instance}}", + "refId": "A" + }, + { + "expr": "sum(rate(mattermost_cluster_cluster_request_duration_seconds_count{instance=~\"$server\"}[5m]))", + "interval": "", + "legendFormat": "Total", + "refId": "B" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Cluster Requests Per Second", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:3241", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "$$hashKey": "object:3242", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ], + "title": "Cluster Metrics", + "type": "row" + }, + { + "collapsed": true, + "datasource": "mattermost", + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 58 + }, + "id": 48, + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "mattermost", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 3 + }, + "hiddenSeries": false, + "id": 46, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.2.1", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "mattermost_jobs_active{instance=~\"$server\"}", + "interval": "", + "legendFormat": "{{instance}}", + "refId": "A" + }, + { + "expr": "sum(mattermost_jobs_active{instance=~\"$server\"})", + "interval": "", + "legendFormat": "Total", + "refId": "B" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Active Jobs", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:4113", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "$$hashKey": "object:4114", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ], + "title": "Job Server", + "type": "row" + }, + { + "collapsed": true, + "datasource": "mattermost", + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 59 + }, + "id": 4, + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "mattermost", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 4 + }, + "hiddenSeries": false, + "id": 2, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.2.1", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "irate(mattermost_process_cpu_seconds_total{instance=~\"$server\"}[5m])* 100", + "interval": "", + "legendFormat": "{{instance}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "CPU Utilization Percentage", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:99", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "$$hashKey": "object:100", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "mattermost", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 4 + }, + "hiddenSeries": false, + "id": 8, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.2.1", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "go_memstats_heap_inuse_bytes{instance=~\"$server\"}", + "interval": "", + "legendFormat": "{{instance}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Heap Utilization", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:288", + "format": "decbytes", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "$$hashKey": "object:289", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "mattermost", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 13 + }, + "hiddenSeries": false, + "id": 10, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.2.1", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "go_goroutines{instance=~\"$server\"}", + "interval": "", + "legendFormat": "{{instance}}", + "refId": "A" + }, + { + "expr": "sum(go_goroutines{instance=~\"$server\"})", + "interval": "", + "legendFormat": "Total", + "refId": "B" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Goroutines", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:1021", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "$$hashKey": "object:1022", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ], + "title": "Resources", + "type": "row" + } + ], + "refresh": "1m", + "schemaVersion": 26, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "allValue": null, + "current": {}, + "datasource": "mattermost", + "definition": "label_values(instance)", + "hide": 0, + "includeAll": false, + "label": "server", + "multi": true, + "name": "server", + "options": [], + "query": "label_values(instance)", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": null, + "current": {}, + "datasource": "mattermost", + "definition": "query_result(topk(10, sum(increase(mattermost_db_store_time_count{instance=~\"$server\"}[${__range_s}s])) by (method)))", + "hide": 0, + "includeAll": true, + "label": null, + "multi": true, + "name": "top_db_count", + "options": [], + "query": "query_result(topk(10, sum(increase(mattermost_db_store_time_count{instance=~\"$server\"}[${__range_s}s])) by (method)))", + "refresh": 2, + "regex": ".*method=\"(.*?)\".*", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": null, + "current": {}, + "datasource": "mattermost", + "definition": "query_result(topk(10, sum(increase(mattermost_db_store_time_sum{instance=~\"$server\"}[${__range_s}s])) by (method) / sum(increase(mattermost_db_store_time_count{instance=~\"$server\"}[${__range_s}s])) by (method)))", + "hide": 0, + "includeAll": true, + "label": null, + "multi": true, + "name": "top_db_latency", + "options": [], + "query": "query_result(topk(10, sum(increase(mattermost_db_store_time_sum{instance=~\"$server\"}[${__range_s}s])) by (method) / sum(increase(mattermost_db_store_time_count{instance=~\"$server\"}[${__range_s}s])) by (method)))", + "refresh": 2, + "regex": ".*method=\"(.*?)\".*", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": null, + "current": {}, + "datasource": "mattermost", + "definition": "query_result(topk(10, sum(increase(mattermost_api_time_count{instance=~\"$server\"}[${__range_s}s])) by (handler)))", + "hide": 0, + "includeAll": true, + "label": null, + "multi": true, + "name": "top_api_count", + "options": [], + "query": "query_result(topk(10, sum(increase(mattermost_api_time_count{instance=~\"$server\"}[${__range_s}s])) by (handler)))", + "refresh": 2, + "regex": ".*handler=\"(.*?)\".*", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": null, + "current": {}, + "datasource": "mattermost", + "definition": "query_result(topk(10, sum(increase(mattermost_api_time_sum{instance=~\"$server\"}[${__range_s}s])) by (handler) / sum(increase(mattermost_api_time_count{instance=~\"$server\"}[${__range_s}s])) by (handler)))", + "hide": 0, + "includeAll": true, + "label": null, + "multi": true, + "name": "top_api_latency", + "options": [], + "query": "query_result(topk(10, sum(increase(mattermost_api_time_sum{instance=~\"$server\"}[${__range_s}s])) by (handler) / sum(increase(mattermost_api_time_count{instance=~\"$server\"}[${__range_s}s])) by (handler)))", + "refresh": 2, + "regex": ".*handler=\"(.*?)\".*", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + } + ] + }, + "time": { + "from": "now-12h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Mattermost Performance Monitoring v2", + "uid": "im7xNX17k", + "version": 9, + "description": "A comprehensive dashboard to monitor Mattermost application performance" +} \ No newline at end of file diff --git a/files/grafana/provisioning/dashboards/automatic.yml b/files/grafana/provisioning/dashboards/automatic.yml new file mode 100644 index 0000000..6fc88f4 --- /dev/null +++ b/files/grafana/provisioning/dashboards/automatic.yml @@ -0,0 +1,24 @@ +apiVersion: 1 + +providers: + # an unique provider name. Required + - name: 'a unique provider name' + # Org id. Default to 1 + orgId: 1 + # name of the dashboard folder. + folder: '' + # folder UID. will be automatically generated if not specified + folderUid: '' + # provider type. Default to 'file' + type: file + # disable dashboard deletion + disableDeletion: false + # how often Grafana will scan for changed dashboards + updateIntervalSeconds: 10 + # allow updating provisioned dashboards from the UI + allowUiUpdates: false + options: + # path to dashboard files on disk. Required when using the 'file' type + path: /var/lib/grafana/dashboards + # use folder names from filesystem to create folders in Grafana + foldersFromFilesStructure: true diff --git a/files/grafana/provisioning/datasources/automatic.yml b/files/grafana/provisioning/datasources/automatic.yml new file mode 100644 index 0000000..fcfac65 --- /dev/null +++ b/files/grafana/provisioning/datasources/automatic.yml @@ -0,0 +1,17 @@ +apiVersion: 1 + +datasources: +- name: mattermost + type: prometheus + access: proxy + url: http://prometheus:9090 + password: + user: + database: + isDefault: true + jsonData: + tlsAuth: false + tlsAuthWithCACert: false + httpMethod: "POST" + version: 1 + editable: true \ No newline at end of file diff --git a/files/prometheus.yml b/files/prometheus.yml new file mode 100644 index 0000000..597c988 --- /dev/null +++ b/files/prometheus.yml @@ -0,0 +1,30 @@ +# my global config +global: + scrape_interval: 5s # By default, scrape targets every 15 seconds. + evaluation_interval: 5s # By default, scrape targets every 15 seconds. + # scrape_timeout is set to the global default (10s). + + # Attach these labels to any time series or alerts when communicating with + # external systems (federation, remote storage, Alertmanager). + external_labels: + monitor: 'mattermost-monitor' + +# Load rules once and periodically evaluate them according to the global 'evaluation_interval'. +rule_files: + # - "first.rules" + # - "second.rules" + +# A scrape configuration containing exactly one endpoint to scrape: +# Here it's Prometheus itself. +scrape_configs: + # The job name is added as a label `job=` to any timeseries scraped from this config. + - job_name: 'prometheus' + + # Override the global default and scrape targets from this job every five seconds. + # scrape_interval: 5s + + # metrics_path defaults to '/metrics' + # scheme defaults to 'http'. + + static_configs: + - targets: ["mattermost:8067"] \ No newline at end of file diff --git a/files/public.crt b/files/public.crt new file mode 100644 index 0000000..59c6d45 --- /dev/null +++ b/files/public.crt @@ -0,0 +1 @@ +MIICozCCAYsCBgGDhvaKdjANBgkqhkiG9w0BAQsFADAVMRMwEQYDVQQDDAptYXR0ZXJtb3N0MB4XDTIyMDkyOTAxNTU0N1oXDTMyMDkyOTAxNTcyN1owFTETMBEGA1UEAwwKbWF0dGVybW9zdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAIhzTzXqXGG9rQbCHVZBJlZsruk+lRSp7dBItPl1Dr0DctaIWc1DXKQMQKLthGyE9RLlW4SyjH08qCo1oqACG4Lg8A1OER/9Gt263/Yim0IBTldzK27g9Xkp8MK6WUGMP4eweuNbu1UhuXy7+cb50dPD8/v0h4+ys1LGHZ0b/maNGN2ehz9nhnmpqrfCc9KDpljuib7AEa5cdscof6YAFQj8pYDidmS3AVE8tGpksuOUQl8FjKVPnmAJbkcQqymVVEMvcRa+O/1qqrSOunrYZsAlQmD74y6UA0kbstSu/K5PFgNGzmmDw/A/u11cPxzh5A7yOCJ3Q9JZBu/882dw/AUCAwEAATANBgkqhkiG9w0BAQsFAAOCAQEANoRIrWqaC6iD/t78S98Rl1VVF86e3Ef2v/bmF3KNFi/twSzFaSuqLSVl9SkWoas8uKWX6AmtBOm9MCPIF7q+d+yAIQkt2UxtuFEsd61Z9Couc4p/rxJGbVGBRqeeTWm8GRUrASaj/JqbZVPM1QtOKpmlCP+5fEq7e/npO0Blfje5pWkAGkA4WhXxYpYVe+cCyXvpcckJLzGCxbGg2iFeD4nmPIO1Drsme35tgwt3gPZhY2DqUTaP/CsauxGi5xv840871kz6mOu75qw4Qpo0MBlSZR2f8IFaHyzZpFyu0p83ZKK3/XTPmuvFfJh59640axZBT6pXWoNp/JyD4KnZSg== \ No newline at end of file diff --git a/keycloak.yml b/keycloak.yml new file mode 100644 index 0000000..a4a9f1a --- /dev/null +++ b/keycloak.yml @@ -0,0 +1,40 @@ + +version: '3' + +volumes: + postgres_data: + driver: local + +services: + # postgres: + # image: postgres + # volumes: + # - postgres_data:/var/lib/postgresql/data + # environment: + # POSTGRES_DB: keycloak + # POSTGRES_USER: keycloak + # POSTGRES_PASSWORD: password + keycloak: + image: quay.io/keycloak/keycloak:latest + environment: + # KC_DB_VENDOR: POSTGRES + # DB_ADDR: postgres + # DB_DATABASE: keycloak + # : keycloak + # DB_SCHEMA: public + # DB_PASSWORD: password + # KC_DB_URL: 'jdbc:postgresql://postgres/keycloak' + # KC_DB_USERNAME: keycloak + # KC_DB: postgres + # KC_DB_PASSWORD: password + KEYCLOAK_ADMIN: admin + KEYCLOAK_ADMIN_PASSWORD: Pa55w0rd + # KC_HOSTNAME: keycloak + # KC_HOSTNAME_PORT + # volumes: + # - ./volumes/keycloak:/opt/jboss/keycloak/standalone/data/ + ports: + - 8080:8080 + depends_on: + postgres: + condition: service_healthy \ No newline at end of file