-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[ML] Adds ML modules for Metrics UI Integration #76460
Changes from 6 commits
3a29942
1d5e0d1
1a6198d
3418147
bcd4620
edb65d3
2051546
1248e27
1288b8f
5f01331
77532b0
9377511
a4bb4fe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"icon": "metricsApp" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{ | ||
"id": "metrics_ui_hosts", | ||
"title": "Metrics Hosts", | ||
"description": "Detect anomalous memory, cpu, and network behavior on hosts.", | ||
"type": "Metricbeat Data", | ||
"logoFile": "logo.json", | ||
"defaultIndexPattern": "metricbeat-*", | ||
"query": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the jobs in this module provide no value without the specific overrides we are expecting from the Metrics UI, then removing this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the |
||
"bool": { | ||
"must": [ | ||
{"exists": {"field": "system"}} | ||
], | ||
"must_not": [ | ||
{"bool": {"filter": [{"exists":{"field": "kubernetes"}}]}}, | ||
{"bool": {"filter": [{"exists":{"field": "docker"}}]}} | ||
] | ||
} | ||
}, | ||
"jobs": [ | ||
{ | ||
"id": "hosts_cpu_usage", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Noticed that the host jobs have an id prefixed with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i've included the k8s prefix on the kubernetes jobs, as we'll want to distinguish between them in ML job management. |
||
"file": "hosts_cpu_usage.json" | ||
}, | ||
{ | ||
"id": "hosts_memory_usage", | ||
"file": "hosts_memory_usage.json" | ||
}, | ||
{ | ||
"id": "hosts_network_in", | ||
"file": "hosts_network_in.json" | ||
}, | ||
{ | ||
"id": "hosts_network_out", | ||
"file": "hosts_network_out.json" | ||
} | ||
], | ||
"datafeeds": [ | ||
{ | ||
"id": "datafeed-hosts_cpu_usage", | ||
"file": "datafeed_hosts_cpu_usage.json", | ||
"job_id": "hosts_cpu_usage" | ||
}, | ||
{ | ||
"id": "datafeed-hosts_memory_usage", | ||
"file": "datafeed_hosts_memory_usage.json", | ||
"job_id": "hosts_memory_usage" | ||
}, | ||
{ | ||
"id": "datafeed-hosts_network_in", | ||
"file": "datafeed_hosts_network_in.json", | ||
"job_id": "hosts_network_in" | ||
}, | ||
{ | ||
"id": "datafeed-hosts_network_out", | ||
"file": "datafeed_hosts_network_out.json", | ||
"job_id": "hosts_network_out" | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
{ | ||
"job_id": "JOB_ID", | ||
"indices": [ | ||
"INDEX_PATTERN_NAME" | ||
], | ||
"indices_options": { | ||
"allow_no_indices": true | ||
}, | ||
"query": { | ||
"bool": { | ||
"must": [ | ||
{ | ||
"exists": { | ||
"field": "system.cpu" | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
"aggs": { | ||
"host.name": { | ||
"terms": { | ||
"field": "host.name", | ||
"size": 1000 | ||
}, | ||
"aggs": { | ||
"buckets": { | ||
"date_histogram": { | ||
"field": "@timestamp", | ||
"fixed_interval": "1m" | ||
}, | ||
"aggs": { | ||
"@timestamp": { | ||
"max": { | ||
"field": "@timestamp" | ||
} | ||
}, | ||
"cpu_user": { | ||
"avg": { | ||
"field": "system.cpu.user.pct" | ||
} | ||
}, | ||
"cpu_system": { | ||
"avg": { | ||
"field": "system.cpu.system.pct" | ||
} | ||
}, | ||
"cpu_cores": { | ||
"max": { | ||
"field": "system.cpu.cores" | ||
} | ||
}, | ||
"cpu": { | ||
"bucket_script": { | ||
"buckets_path": { | ||
"user": "cpu_user", | ||
"system": "cpu_system", | ||
"cores": "cpu_cores" | ||
}, | ||
"script": "(params.user + params.system) / params.cores", | ||
"gap_policy": "skip" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"job_id": "JOB_ID", | ||
"indices": [ | ||
"INDEX_PATTERN_NAME" | ||
], | ||
"indices_options": { | ||
"allow_no_indices": true | ||
}, | ||
"query": { | ||
"bool": { | ||
"must": [ | ||
{"exists": {"field": "system.memory"}} | ||
] | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"job_id": "JOB_ID", | ||
"indices": [ | ||
"INDEX_PATTERN_NAME" | ||
], | ||
"indices_options": { | ||
"allow_no_indices": true | ||
}, | ||
"query": { | ||
"bool": { | ||
"must": [ | ||
{"exists": {"field": "system.network"}} | ||
] | ||
} | ||
}, | ||
"chunking_config": { | ||
"mode": "manual", | ||
"time_span": "1000s" | ||
}, | ||
"aggregations": { | ||
"host.name": {"terms": {"field": "host.name"}, | ||
"aggregations": { | ||
"buckets": { | ||
"date_histogram": {"field": "@timestamp","fixed_interval": "5m"}, | ||
"aggregations": { | ||
"@timestamp": {"max": {"field": "@timestamp"}}, | ||
"bytes_in_max": {"max": {"field": "system.network.in.bytes"}}, | ||
"bytes_in_derivative": {"derivative": {"buckets_path": "bytes_in_max"}}, | ||
"positive_only":{ | ||
"bucket_script": { | ||
"buckets_path": {"in_derivative": "bytes_in_derivative.value"}, | ||
"script": "params.in_derivative > 0.0 ? params.in_derivative : 0.0" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"job_id": "JOB_ID", | ||
"indices": [ | ||
"INDEX_PATTERN_NAME" | ||
], | ||
"indices_options": { | ||
"allow_no_indices": true | ||
}, | ||
"query": { | ||
"bool": { | ||
"must": [ | ||
{"exists": {"field": "system.network"}} | ||
] | ||
} | ||
}, | ||
"chunking_config": { | ||
"mode": "manual", | ||
"time_span": "1000s" | ||
}, | ||
"aggregations": { | ||
"host.name": {"terms": {"field": "host.name"}, | ||
"aggregations": { | ||
"buckets": { | ||
"date_histogram": {"field": "@timestamp","fixed_interval": "5m"}, | ||
"aggregations": { | ||
"@timestamp": {"max": {"field": "@timestamp"}}, | ||
"bytes_out_max": {"max": {"field": "system.network.out.bytes"}}, | ||
"bytes_out_derivative": {"derivative": {"buckets_path": "bytes_out_max"}}, | ||
"positive_only":{ | ||
"bucket_script": { | ||
"buckets_path": {"out_derivative": "bytes_out_derivative.value"}, | ||
"script": "params.out_derivative > 0.0 ? params.out_derivative : 0.0" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,51 @@ | ||||||
{ | ||||||
"job_type": "anomaly_detector", | ||||||
"groups": [ | ||||||
"hosts", | ||||||
"metrics" | ||||||
], | ||||||
"description": "Metrics: Hosts - Identify unusual spikes in cpu utilization across hosts.", | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated - thanks! |
||||||
"analysis_config": { | ||||||
"bucket_span": "15m", | ||||||
"summary_count_field_name": "doc_count", | ||||||
"detectors": [ | ||||||
{ | ||||||
"detector_description": "max('cpu')", | ||||||
"function": "max", | ||||||
"field_name": "cpu", | ||||||
"custom_rules": [ | ||||||
{ | ||||||
"actions": [ | ||||||
"skip_result" | ||||||
], | ||||||
"conditions": [ | ||||||
{ | ||||||
"applies_to": "actual", | ||||||
"operator": "lt", | ||||||
"value": 0.1 | ||||||
} | ||||||
] | ||||||
} | ||||||
] | ||||||
} | ||||||
], | ||||||
"influencers": [ | ||||||
"host.name" | ||||||
] | ||||||
}, | ||||||
"data_description": { | ||||||
"time_field": "@timestamp" | ||||||
}, | ||||||
"analysis_limits": { | ||||||
"model_memory_limit": "64mb" | ||||||
}, | ||||||
"custom_settings": { | ||||||
"created_by": "ml-module-metrics-ui-hosts", | ||||||
"custom_urls": [ | ||||||
{ | ||||||
"url_name": "Host Metrics", | ||||||
"url_value": "metrics/detail/host/$host.name$?metricTime=(autoReload:!f,refreshInterval:5000,time:(from:%27$earliest$%27,interval:%3E%3D1m,to:%27$latest$%27))" | ||||||
} | ||||||
] | ||||||
} | ||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"job_type": "anomaly_detector", | ||
"groups": [ | ||
"hosts", | ||
"metrics" | ||
], | ||
"description": "Metrics: Hosts - Identify unusual spikes in memory usage across hosts.", | ||
"analysis_config": { | ||
"bucket_span": "15m", | ||
"detectors": [ | ||
{ | ||
"detector_description": "max('system.memory.actual.used.pct')", | ||
"function": "max", | ||
"field_name": "system.memory.actual.used.pct", | ||
"custom_rules": [ | ||
{ | ||
"actions": [ | ||
"skip_result" | ||
], | ||
"conditions": [ | ||
{ | ||
"applies_to": "actual", | ||
"operator": "lt", | ||
"value": 0.1 | ||
} | ||
] | ||
} | ||
] | ||
} | ||
], | ||
"influencers": [ | ||
"host.name" | ||
] | ||
}, | ||
"data_description": { | ||
"time_field": "@timestamp" | ||
}, | ||
"analysis_limits": { | ||
"model_memory_limit": "64mb" | ||
}, | ||
"custom_settings": { | ||
"created_by": "ml-module-metrics-ui-hosts", | ||
"custom_urls": [ | ||
{ | ||
"url_name": "Host Metrics", | ||
"url_value": "metrics/detail/host/$host.name$?metricTime=(autoReload:!f,refreshInterval:5000,time:(from:%27$earliest$%27,interval:%3E%3D1m,to:%27$latest$%27))" | ||
} | ||
] | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"job_type": "anomaly_detector", | ||
"description": "Metrics: Hosts - Identify unusual spikes in inbound traffic across hosts.", | ||
"groups": [ | ||
"hosts", | ||
"metrics" | ||
], | ||
"analysis_config": { | ||
"bucket_span": "15m", | ||
"detectors": [ | ||
{ | ||
"detector_description": "max(bytes_in_derivative)", | ||
"function": "max", | ||
"field_name": "bytes_in_derivative" | ||
} | ||
], | ||
"influencers": [ | ||
"host.name" | ||
], | ||
"summary_count_field_name": "doc_count" | ||
}, | ||
"model_plot_config": { | ||
"enabled": "true" | ||
}, | ||
"data_description": { | ||
"time_field": "@timestamp" | ||
}, | ||
"analysis_limits": { | ||
"model_memory_limit": "32mb" | ||
}, | ||
"custom_settings": { | ||
"created_by": "ml-module-metrics-ui-hosts", | ||
"custom_urls": [ | ||
{ | ||
"url_name": "Host Metrics", | ||
"url_value": "metrics/detail/host/$host.name$?metricTime=(autoReload:!f,refreshInterval:5000,time:(from:%27$earliest$%27,interval:%3E%3D1m,to:%27$latest$%27))" | ||
} | ||
] | ||
} | ||
} |
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.
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.
updated - thanks!