-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Stack Monitoring] update rules queries to support metricbeat 8.0 [fixed PR] #125748
[Stack Monitoring] update rules queries to support metricbeat 8.0 [fixed PR] #125748
Conversation
bb1b054
to
dcf4de6
Compare
x-pack/plugins/monitoring/server/lib/alerts/create_dataset_query_filter.ts
Show resolved
Hide resolved
@@ -134,15 +135,20 @@ export async function fetchIndexShardSize( | |||
} | |||
const { | |||
_index: monitoringIndexName, | |||
_source: { index_stats: indexStats }, | |||
_source: { index_stats: indexStats, elasticsearch }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you just declare indexStats like this:
const indexStats = topHit._source.index_stats || topHit._source.elasticsearch?.index
, I don't think you'd need to make any other changes below this line @klacabane
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will make the 8.0.1 backport a bit more painful in this file as well.
💚 Build SucceededMetrics [docs]
History
To update your PR or re-run it, just comment with: |
Thanks to the amazing new PR cloud deploy tool, I've just verified this PR fixes the SM CPU, Memory (JVM), and Disk Usage alerts in cloud! 🙌 |
💔 All backports failed
How to fixRe-run the backport manually:
Questions ?Please refer to the Backport tool documentation |
…xed PR] (elastic#125748) * update queries to use metricset.name and fix paths * fix ccr query * fix cluster health query paths * update elasticsearch version mismatch * update fetchLicense paths * use ecs properties in fetch_index_shard_size * Clarified comment about createDatasetFilter * Re-editing a clarifying comment * Small comment edit * Revert "use ecs properties in fetch_index_shard_size" This reverts commit cdf8b24. * simplify fetch_index_shard_size document handling Co-authored-by: neptunian <[email protected]> Co-authored-by: klacabane <[email protected]> (cherry picked from commit 7126bc9) # Conflicts: # x-pack/plugins/monitoring/server/lib/alerts/fetch_clusters.ts
…xed PR] (elastic#125748) * update queries to use metricset.name and fix paths * fix ccr query * fix cluster health query paths * update elasticsearch version mismatch * update fetchLicense paths * use ecs properties in fetch_index_shard_size * Clarified comment about createDatasetFilter * Re-editing a clarifying comment * Small comment edit * Revert "use ecs properties in fetch_index_shard_size" This reverts commit cdf8b24. * simplify fetch_index_shard_size document handling Co-authored-by: neptunian <[email protected]> Co-authored-by: klacabane <[email protected]> (cherry picked from commit 7126bc9) # Conflicts: # x-pack/plugins/monitoring/server/lib/alerts/create_dataset_query_filter.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_ccr_read_exceptions.test.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_ccr_read_exceptions.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_cluster_health.test.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_cluster_health.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_clusters.test.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_clusters.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_cpu_usage_node_stats.test.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_cpu_usage_node_stats.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_disk_usage_node_stats.test.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_disk_usage_node_stats.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_elasticsearch_versions.test.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_elasticsearch_versions.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_index_shard_size.test.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_index_shard_size.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_kibana_versions.test.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_kibana_versions.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_licenses.test.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_licenses.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_logstash_versions.test.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_logstash_versions.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_memory_usage_node_stats.test.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_memory_usage_node_stats.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_missing_monitoring_data.test.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_missing_monitoring_data.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_nodes_from_cluster_stats.test.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_nodes_from_cluster_stats.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_thread_pool_rejections_stats.ts
….0 [fixed PR] (#125748) (#125856) * [Stack Monitoring] update rules queries to support metricbeat 8.0 [fixed PR] (#125748) * update queries to use metricset.name and fix paths * fix ccr query * fix cluster health query paths * update elasticsearch version mismatch * update fetchLicense paths * use ecs properties in fetch_index_shard_size * Clarified comment about createDatasetFilter * Re-editing a clarifying comment * Small comment edit * Revert "use ecs properties in fetch_index_shard_size" This reverts commit cdf8b24. * simplify fetch_index_shard_size document handling Co-authored-by: neptunian <[email protected]> Co-authored-by: klacabane <[email protected]> (cherry picked from commit 7126bc9) # Conflicts: # x-pack/plugins/monitoring/server/lib/alerts/fetch_clusters.ts * esClient still returns metadata Co-authored-by: Jason Rhodes <[email protected]>
….0 [fixed PR] (#125748) (#125877) * [Stack Monitoring] update rules queries to support metricbeat 8.0 [fixed PR] (#125748) * update queries to use metricset.name and fix paths * fix ccr query * fix cluster health query paths * update elasticsearch version mismatch * update fetchLicense paths * use ecs properties in fetch_index_shard_size * Clarified comment about createDatasetFilter * Re-editing a clarifying comment * Small comment edit * Revert "use ecs properties in fetch_index_shard_size" This reverts commit cdf8b24. * simplify fetch_index_shard_size document handling Co-authored-by: neptunian <[email protected]> Co-authored-by: klacabane <[email protected]> (cherry picked from commit 7126bc9) # Conflicts: # x-pack/plugins/monitoring/server/lib/alerts/create_dataset_query_filter.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_ccr_read_exceptions.test.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_ccr_read_exceptions.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_cluster_health.test.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_cluster_health.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_clusters.test.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_clusters.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_cpu_usage_node_stats.test.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_cpu_usage_node_stats.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_disk_usage_node_stats.test.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_disk_usage_node_stats.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_elasticsearch_versions.test.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_elasticsearch_versions.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_index_shard_size.test.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_index_shard_size.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_kibana_versions.test.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_kibana_versions.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_licenses.test.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_licenses.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_logstash_versions.test.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_logstash_versions.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_memory_usage_node_stats.test.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_memory_usage_node_stats.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_missing_monitoring_data.test.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_missing_monitoring_data.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_nodes_from_cluster_stats.test.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_nodes_from_cluster_stats.ts # x-pack/plugins/monitoring/server/lib/alerts/fetch_thread_pool_rejections_stats.ts * import createDatasetFilter * target correct filter property Co-authored-by: Jason Rhodes <[email protected]>
Fixes #125035
Summary
This PR replaces #125315 because I screwed that one up with a bad merge that resulted in tons of commits getting mixed into the PR.
@neptunian's original summary was:
TODO
Backporting to 8.0.1 notes:
createDatasetFilter
doesn't exist in 8.0.0 so will need add themetricset.name
in abool
should
along withtype
(legacy). no need to adddata_stream.dataset
term