-
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
[Logs UI] Add ML job results APIs #42356
[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 |
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.
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_rate
This route grants access to the log rate anomaly detection results within a given time interval.
Failure conditions:
Not Found
Forbidden
Implementation Notes
io-ts
runtime 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_analysis
that can be built upon in later PRs.Testing Hints
kibana-logs-ui-${spaceId}-${sourceId}-${jobType}
.@timestamp
field 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