-
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
[Monitoring] Convert Beats-related server files that read from _source to typescript #85193
[Monitoring] Convert Beats-related server files that read from _source to typescript #85193
Conversation
Pinging @elastic/stack-monitoring (Team:Monitoring) |
@@ -25,47 +46,47 @@ export function handleResponse(response, start, end) { | |||
|
|||
// add another beat summary | |||
accum.ids.add(uuid); | |||
const earliestStats = get(hit, 'inner_hits.earliest.hits.hits[0]._source.beats_stats'); | |||
const earliestStats = hit.inner_hits.earliest.hits.hits[0]._source.beats_stats; |
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.
I think this might need some safeguarding as well, something like:
const earliestStats = hit.inner_hits.earliest.hits.hits[0]._source.beats_stats; | |
const earliestStats = hit.inner_hits?.earliest?.hits?.hits[0]?._source?.beats_stats; |
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.
Just a small fix here, but other than that looks good 👍
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.
Looks good 👍
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]Distributable file count
History
To update your PR or re-run it, just comment with: |
…e to typescript (elastic#85193) * Beats to TS * PR feedback * Fix types * Fix types * Fix failing test Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Relates to #84370
This PR updates a couple source files used for Beats monitoring that read from source to using Typescript. This is an attempt to identify all fields read from source to help with #73864
I'm going to try and do one PR for each stack product to avoid long reviews.