[Monitoring] Update /api/stats to use core.metrics#60974
Merged
chrisronline merged 8 commits intoelastic:masterfrom Mar 24, 2020
Merged
[Monitoring] Update /api/stats to use core.metrics#60974chrisronline merged 8 commits intoelastic:masterfrom
chrisronline merged 8 commits intoelastic:masterfrom
Conversation
Contributor
|
Pinging @elastic/stack-monitoring (Team:Monitoring) |
pgayvallet
approved these changes
Mar 24, 2020
x-pack/plugins/monitoring/server/kibana_monitoring/collectors/get_ops_stats_collector.ts
Outdated
Show resolved
Hide resolved
igoristic
reviewed
Mar 24, 2020
| let lastMetrics: MonitoringOpsMetrics | null = null; | ||
| metrics$.subscribe(metrics => { | ||
| metrics$.subscribe(_metrics => { | ||
| const metrics: any = cloneDeep(_metrics); |
Contributor
There was a problem hiding this comment.
nit: I don't think we need to use cloneDeep here (unless metrics is somehow a reference), and looks like _metrics is not used anywhere else. Don't know if Observables hold references though, in which case maybe shallow might be good enough?:
metrics$.subscribe(({ ...metrics }) => {
Only mentioning because I know cloneDeep can be pretty expensive
Contributor
Author
There was a problem hiding this comment.
Yea I tried it without it and any delete or re-setting the object caused issues with the other subscriber.
igoristic
reviewed
Mar 24, 2020
x-pack/plugins/monitoring/server/kibana_monitoring/collectors/get_ops_stats_collector.ts
Outdated
Show resolved
Hide resolved
Contributor
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
Contributor
Author
|
Backport: 7.x: e439836 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Relates to #56675
After migration the Stack Monitoring server to new platform, we had a set of parity tests fails: https://internal-ci.elastic.co/job/elastic+estf-monitoring-snapshots+master+multijob-kibana/157/console
This is because internal collection (of monitoring data) goes through the monitoring code base, which was updated to use the new
core.metricsAPI. Metricbeat collection goes through the/api/statsendpoint, which still exists in legacy.This PR updates the
/api/statsendpoint to use the newcore.metricsAPI.It also fixes some other issues with parity between Metricbeat collection of
kibana_statsandkibana_settingsdocuments.kibana_statsInternal
Metricbeat
kibana_settingsInternal
Metricbeat
I ran the parity tests with a locally built version of Kibana from this PR and they are passing!