[Logs UI] Add ML job results APIs#42356
Conversation
|
Pinging @elastic/infra-logs-ui |
💔 Build Failed |
💔 Build Failed |
💚 Build Succeeded |
💔 Build Failed |
💚 Build Succeeded |
💔 Build Failed |
|
that's a not-so-nice way to learn that we have firefox smoke tests... jenkins, test this again |
💚 Build Succeeded |
|
and flaky smoke tests at that... sorry for the noise |
|
Functionally this works great after playing around with the API via curl 👍 One thing I did want to do - and isn't explicitly linked to this API as it's not responsible for the job setup - is try to setup the job and datafeed via the appropriate APIs using the configuration in the "Testing Hints". I hit a snag there doing that against my locally running cluster - I got the following error: Out of interest - is there something I'm missing there? I know it's not directly related to this work, but I want to make sure I'm fully understanding the job setup portion that pairs with these results. This works great against the shared cluster using the pre-existing Will go through the code now. |
|
Sorry, that was my mistake. 🙈 The datafeed definition is incomplete because it's missing the histogram aggregation that produces buckets with {
"datafeed_id": "datafeed-kibana-logs-ui-testspace-default-log-entry-rate",
"job_id": "kibana-logs-ui-testspace-default-log-entry-rate",
"indexes": ["filebeat-*"],
"aggregations": {
"buckets": {
"date_histogram": {
"field": "@timestamp",
"fixed_interval": "900000ms"
},
"aggregations": {
"@timestamp": {
"max": {
"field": "@timestamp"
}
}
}
}
}
} |
Ah, nice! That's much better than what I thought, which is that I'd fundamentally misunderstood something, epsecially r.e. how |
Kerry350
left a comment
There was a problem hiding this comment.
Nice work! 🎉
As we're still evaluating io-ts and our general "simple HTTP API" approach, I'll add that the code here was easy to follow for me (the types, encoding, decoding etc all made sense).
This PR adds a route that can be used to fetch the log entry rate anomaly job results when a corresponding job has been set up.
Summary
This PR adds a route that can be used to fetch the log entry rate anomaly job results when a corresponding job has been set up.
closes #42057
New Routes
POST /api/infra/log_analysis/results/log_entry_rateThis route grants access to the log rate anomaly detection results within a given time interval.
Failure conditions:
Not FoundForbiddenImplementation Notes
io-tsruntime types used to validate and type the request and response payloads on both server- and client-side are located incommon/http_api/log_analysis/results.common/log_analysis/job_parameters.ts.public/containers/logs/log_analysisthat can be built upon in later PRs.Testing Hints
kibana-logs-ui-${spaceId}-${sourceId}-${jobType}.{ "job_id": "kibana-logs-ui-testspace-default-log-entry-rate", "analysis_config": { "bucket_span": "15m", "summary_count_field_name": "doc_count", "detectors": [ { "detector_description": "count", "function": "count", "detector_index": 0 } ], "influencers": [] }, "data_description": { "time_field": "@timestamp", "time_format": "epoch_ms" }, "model_plot_config": { "enabled": true } }{ "datafeed_id": "datafeed-kibana-logs-ui-testspace-default-log-entry-rate", "job_id": "kibana-logs-ui-testspace-default-log-entry-rate", "indexes": ["filebeat-*"], "aggregations": { "buckets": { "date_histogram": { "field": "@timestamp", "fixed_interval": "900000ms" }, "aggregations": { "@timestamp": { "max": { "field": "@timestamp" } } } } } }@timestampfield are present in the cluster./s/testspace/api/infra/log_analysis/results/log_entry_rate.Checklist
[ ] This was checked for cross-browser compatibility, including a check against IE11[ ] Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support[ ] Documentation was added for features that require explanation or tutorials[ ] This was checked for keyboard-only and screenreader accessibility