Skip to content
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

Merged
merged 7 commits into from
Dec 14, 2020

Conversation

chrisronline
Copy link
Contributor

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.

@chrisronline chrisronline added review Team:Monitoring Stack Monitoring team v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.11.0 labels Dec 7, 2020
@chrisronline chrisronline self-assigned this Dec 7, 2020
@chrisronline chrisronline requested a review from a team December 7, 2020 20:53
@elasticmachine
Copy link
Contributor

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;
Copy link
Contributor

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:

Suggested change
const earliestStats = hit.inner_hits.earliest.hits.hits[0]._source.beats_stats;
const earliestStats = hit.inner_hits?.earliest?.hits?.hits[0]?._source?.beats_stats;

Copy link
Contributor

@igoristic igoristic left a 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 👍

Copy link
Contributor

@igoristic igoristic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

@chrisronline
Copy link
Contributor Author

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Distributable file count

id before after diff
default 47129 47889 +760

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@chrisronline chrisronline merged commit 6ae00fb into elastic:master Dec 14, 2020
@chrisronline chrisronline deleted the monitoring/ecs_ts_beats branch December 14, 2020 17:12
chrisronline added a commit to chrisronline/kibana that referenced this pull request Dec 14, 2020
…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>
chrisronline added a commit that referenced this pull request Dec 14, 2020
…e to typescript (#85193) (#85814)

* Beats to TS

* PR feedback

* Fix types

* Fix types

* Fix failing test

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes review Team:Monitoring Stack Monitoring team v7.11.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants