-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[ML] Adds ML modules for Metrics UI Integration #76460
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
Changes from 1 commit
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_hosts", | ||
| "title": "Metrics Hosts", | ||
| "description": "", | ||
| "type": "Metricbeat Data", | ||
| "logoFile": "logo.json", | ||
| "defaultIndexPattern": "metricbeat-*", | ||
| "query": { | ||
| "bool": { | ||
| "must": [ | ||
| {"exists": {"field": "system"}} | ||
| ], | ||
| "must_not": [ | ||
| {"bool": {"filter": [{"exists":{"field": "kubernetes"}}]}}, | ||
| {"bool": {"filter": [{"exists":{"field": "docker"}}]}} | ||
| ] | ||
| } | ||
| }, | ||
| "jobs": [ | ||
| { | ||
| "id": "hosts_cpu_usage", | ||
|
||
| "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,66 @@ | ||
| { | ||
| "job_id": "JOB_ID", | ||
| "indices": [ | ||
| "INDEX_PATTERN_NAME" | ||
| ], | ||
| "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,13 @@ | ||
| { | ||
| "job_id": "JOB_ID", | ||
| "indices": [ | ||
| "INDEX_PATTERN_NAME" | ||
| ], | ||
| "query": { | ||
| "bool": { | ||
| "must": [ | ||
| {"exists": {"field": "system.memory"}} | ||
| ] | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| { | ||
| "job_id": "JOB_ID", | ||
| "indices": [ | ||
| "INDEX_PATTERN_NAME" | ||
| ], | ||
| "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,37 @@ | ||
| { | ||
| "job_id": "JOB_ID", | ||
| "indices": [ | ||
| "INDEX_PATTERN_NAME" | ||
| ], | ||
| "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": {"in_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,41 @@ | ||
| { | ||
| "job_type": "anomaly_detector", | ||
| "groups": [ | ||
| "hosts", | ||
| "metrics" | ||
| ], | ||
| "description": "", | ||
| "analysis_config": { | ||
| "bucket_span": "15m", | ||
| "detectors": [ | ||
| { | ||
| "detector_description": "max('cpu') partitionfield='host.name'", | ||
| "function": "max", | ||
| "field_name": "cpu", | ||
| "custom_rules": [ | ||
| { | ||
| "actions": [ | ||
| "skip_result" | ||
| ], | ||
| "conditions": [ | ||
| { | ||
| "applies_to": "actual", | ||
| "operator": "lt", | ||
| "value": 0.1 | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "influencers": [ | ||
| "host.name" | ||
| ] | ||
| }, | ||
| "analysis_limits": { | ||
| "model_memory_limit": "64mb" | ||
| }, | ||
| "custom_settings": { | ||
| "created_by": "ml-module-metrics-hosts" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| { | ||
| "job_type": "anomaly_detector", | ||
| "groups": [ | ||
| "hosts", | ||
| "metrics" | ||
| ], | ||
| "description": "", | ||
| "analysis_config": { | ||
| "bucket_span": "15m", | ||
| "detectors": [ | ||
| { | ||
| "detector_description": "max(\"system.memory.actual.used.pct\") partitionfield=\"host.name\"", | ||
| "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" | ||
| ] | ||
| }, | ||
| "analysis_limits": { | ||
| "model_memory_limit": "64mb" | ||
| }, | ||
| "custom_settings": { | ||
| "created_by": "ml-module-metrics-hosts" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| { | ||
| "job_type": "anomaly_detector", | ||
| "description": "", | ||
| "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-hosts" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| { | ||
| "job_type": "anomaly_detector", | ||
| "description": "", | ||
| "groups": [ | ||
| "hosts", | ||
| "metrics" | ||
| ], | ||
| "analysis_config": { | ||
| "bucket_span": "15m", | ||
| "detectors": [ | ||
| { | ||
| "detector_description": "max(bytes_out_derivative)", | ||
| "function": "max", | ||
| "field_name": "bytes_out_derivative" | ||
| } | ||
| ], | ||
| "influencers": [ | ||
| "host.name" | ||
| ], | ||
| "summary_count_field_name": "doc_count" | ||
| }, | ||
| "data_description": { | ||
| "time_field": "@timestamp" | ||
| }, | ||
| "analysis_limits": { | ||
| "model_memory_limit": "32mb" | ||
| }, | ||
| "custom_settings": { | ||
| "created_by": "ml-module-metrics-hosts" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "icon": "metricsApp" | ||
| } |
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 the jobs in this module provide no value without the specific overrides we are expecting from the Metrics UI, then removing this
queryblock is the way to hide it from the ML job wizards.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.
the
queryanddefaultIndexPatternfields have been removed, as we do in the logs integration modules.