-
Notifications
You must be signed in to change notification settings - Fork 515
[MySQL] Add alerting rule templates #15418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
lalit-satapathy
merged 19 commits into
elastic:main
from
gpop63:add_mysql_alert_rule_templates
Nov 24, 2025
Merged
Changes from 9 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
1691262
add initial alert rule templates
gpop63 0447588
bump package version
gpop63 b354b19
fix pr id
gpop63 89f21b5
Merge remote-tracking branch 'upstream/main' into add_mysql_alert_rul…
gpop63 1a80b88
fix conflicts
gpop63 5a2ccb1
fix alerts folder name
gpop63 a4ede27
fix slowlog pipeline
gpop63 b9ed91c
address comments
gpop63 6dfdc21
update time window
gpop63 999df8e
fix typo
gpop63 7a874e7
use 1e9 instead of 1e6
gpop63 03ca520
add backticks
gpop63 12fcd45
improve namings and tags
gpop63 2cf7b78
improve namings and remove fields
gpop63 fd5bbde
improve esql queries
gpop63 7994815
update stack and format version
gpop63 00ca885
Update packages/mysql/changelog.yml
gpop63 5ae1a38
Merge branch 'main' into add_mysql_alert_rule_templates
muthu-mps 9e385b8
bump kibana version
gpop63 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
packages/mysql/kibana/alerting_rule_template/mysql-galera-cluster-state.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| { | ||
| "id": "mysql-galera-cluster-state", | ||
| "type": "alerting_rule_template", | ||
| "attributes": { | ||
| "name": "MySQL Galera Cluster State", | ||
| "tags": ["mysql", "galera"], | ||
| "ruleTypeId": ".es-query", | ||
| "schedule": { | ||
| "interval": "1m" | ||
| }, | ||
| "params": { | ||
| "searchType": "esqlQuery", | ||
| "timeWindowSize": 15, | ||
| "timeWindowUnit": "m", | ||
| "threshold": [ | ||
| 0 | ||
| ], | ||
| "thresholdComparator": ">", | ||
| "size": 100, | ||
| "esqlQuery": { | ||
| "esql": "FROM metrics-mysql.galera_status-default\n| STATS statuses = VALUES(mysql.galera_status.connected) BY host.name\n| WHERE \"ON\" != statuses" | ||
| }, | ||
| "aggType": "count", | ||
| "groupBy": "all", | ||
| "termSize": 5, | ||
| "sourceFields": [], | ||
| "timeField": "@timestamp", | ||
| "excludeHitsFromPreviousRun": true | ||
| }, | ||
| "alertDelay": { | ||
| "active": 1 | ||
| } | ||
| }, | ||
| "managed": true, | ||
| "coreMigrationVersion": "8.8.0", | ||
| "typeMigrationVersion": "10.1.0" | ||
| } |
37 changes: 37 additions & 0 deletions
37
packages/mysql/kibana/alerting_rule_template/mysql-replication-lag.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| { | ||
| "id": "mysql-replication-lag", | ||
| "type": "alerting_rule_template", | ||
| "attributes": { | ||
| "name": "MySQL Replication Lag", | ||
| "tags": ["mysql", "replication"], | ||
| "ruleTypeId": ".es-query", | ||
| "schedule": { | ||
| "interval": "1m" | ||
| }, | ||
| "params": { | ||
| "searchType": "esqlQuery", | ||
| "timeWindowSize": 15, | ||
| "timeWindowUnit": "m", | ||
| "threshold": [ | ||
| 0 | ||
| ], | ||
| "thresholdComparator": ">", | ||
| "size": 100, | ||
| "esqlQuery": { | ||
| "esql": "FROM metrics-mysql.replica_status-default\n| STATS secondsbehind=max(mysql.replica_status.seconds_behind_source) by host.name, mysql.replica_status.channel.name\n| WHERE secondsbehind > 10" | ||
| }, | ||
| "aggType": "count", | ||
| "groupBy": "all", | ||
| "termSize": 5, | ||
| "sourceFields": [], | ||
| "timeField": "@timestamp", | ||
| "excludeHitsFromPreviousRun": true | ||
| }, | ||
| "alertDelay": { | ||
| "active": 1 | ||
| } | ||
| }, | ||
| "managed": true, | ||
| "coreMigrationVersion": "8.8.0", | ||
| "typeMigrationVersion": "10.1.0" | ||
| } |
37 changes: 37 additions & 0 deletions
37
packages/mysql/kibana/alerting_rule_template/mysql-slow-queries.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| { | ||
| "id": "mysql-slow-queries", | ||
| "type": "alerting_rule_template", | ||
| "attributes": { | ||
| "name": "MySQL Slow Queries P95 Latency", | ||
| "tags": ["mysql", "query"], | ||
| "ruleTypeId": ".es-query", | ||
| "schedule": { | ||
| "interval": "1m" | ||
| }, | ||
| "params": { | ||
| "searchType": "esqlQuery", | ||
| "timeWindowSize": 15, | ||
| "timeWindowUnit": "m", | ||
| "threshold": [ | ||
| 0 | ||
| ], | ||
| "thresholdComparator": ">", | ||
| "size": 100, | ||
| "esqlQuery": { | ||
| "esql": "FROM metrics-mysql.performance-default\n| STATS p95_ms = max(mysql.performance.events_statements.quantile.95/1e6) BY host.name, mysql.performance.events_statements.query_id, mysql.performance.events_statements.schemanamen\n| WHERE p95_ms > 500" | ||
gpop63 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| }, | ||
| "aggType": "count", | ||
| "groupBy": "all", | ||
| "termSize": 5, | ||
| "sourceFields": [], | ||
| "timeField": "@timestamp", | ||
| "excludeHitsFromPreviousRun": true | ||
| }, | ||
| "alertDelay": { | ||
| "active": 1 | ||
| } | ||
| }, | ||
| "managed": true, | ||
| "coreMigrationVersion": "8.8.0", | ||
| "typeMigrationVersion": "10.1.0" | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.