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

Stack monitoring - standalone metricbeat 8.0 compatibility #120825

Closed
8 tasks done
klacabane opened this issue Dec 8, 2021 · 11 comments
Closed
8 tasks done

Stack monitoring - standalone metricbeat 8.0 compatibility #120825

klacabane opened this issue Dec 8, 2021 · 11 comments
Assignees
Labels
Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services

Comments

@klacabane
Copy link
Contributor

klacabane commented Dec 8, 2021

This ticket tracks the action items necessary to make the Stack monitoring UI compatible with metricbeat standalone 8.x.

Steps to setup an environment with the new templates:

Action items:

Related items:

AC:

  • stack monitoring UI is powered by data written in .monitoring-{product}-8 data streams
  • UI parity with data generated by standalone metricbeat 7.x and metricbeat 8.x
  • existing _mb functional tests should be updated to write their respective archives to the new .monitoring-{product}-8 datastreams
  • Reasonable coverage on Test Plan

Quick test of the metricbeat 8.0 standalone mode that naively merges the individual elasticsearch integration mappings into a new index template.

Observations:

  • UI loads in main branch but the datastream-compatible changes shows a No Data screen. This is most likely because we removed filter terms for metricbeat-* documents and documents inserted in standalone mode don't have the data_stream.dataset, or the legacy type property
  • Indices tab does not load any data which is most likely related to this issue
  • Nodes overview displays N/A for CPU usage and CPU throttling when it shows data with the documents inserted by the elastic agent
  • Node details page fail to load with
    TypeError: Cannot read properties of undefined (reading 'key')
        at reduce (/Users/lacabane/workspace/kibana/x-pack/plugins/monitoring/server/lib/elasticsearch/shards/normalize_shard_objects.ts:51:44)
        at Array.reduce (<anonymous>)
        at handleResponse (/Users/lacabane/workspace/kibana/x-pack/plugins/monitoring/server/lib/elasticsearch/shards/get_shard_stats.ts:46:46)
    

The last two points are probably related to the naive property merge, I'll have a look.

@klacabane klacabane added the Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services label Dec 8, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/infra-monitoring-ui (Team:Infra Monitoring UI)

@klacabane
Copy link
Contributor Author

klacabane commented Dec 8, 2021

Regarding

Node details page fail to load with

TypeError: Cannot read properties of undefined (reading 'key')
    at reduce (/Users/lacabane/workspace/kibana/x-pack/plugins/monitoring/server/lib/elasticsearch/shards/normalize_shard_objects.ts:51:44)
    at Array.reduce (<anonymous>)
    at handleResponse (/Users/lacabane/workspace/kibana/x-pack/plugins/monitoring/server/lib/elasticsearch/shards/get_shard_stats.ts:46:46)

The query returns an empty bucket for the node_names and that's, I assume, because the source_node.name which aliases to elasticsearch.node.name is not set in the shard documents produced by metricbeat 8, only the source_node.uuid. I confirmed that documents produced by metricbeat 7 did have the property set.


We fixed this in the datastream compatibility PR.

Applying the same fix to main branch solves the issues related to Node's missing CPU data and the Node details page not loading. So the merge was actually successful as far as the smoke test goes

@klacabane
Copy link
Contributor Author

I ran a diff of the template generated from the datastream mappings and the one built manually. One thing to consider is that we don't have a beats integrations package so we're missing the relevant properties in the template constructed from datastreams mappings, namely beat, beats_state and beats_stats.

There are other differences, like missing index_stats which was already known, the event root property and some property types like elasticsearch.cluster.pending_task.priority being a long or a keyword.

Full diff

@klacabane
Copy link
Contributor Author

klacabane commented Dec 13, 2021

Created the templates here and currently going through some manual tests:

  • Elasticsearch data shows up
  • Kibana data does not show up while documents are being indexed. It also fails with the manual mappings. It could be related to the elasticsearch.cluster.id not being set. The indexed stats documents have the property under kibana.elasticsearch.cluster.id which looks like a definition error in metricbeat ?
    Should the property be assigned to RootFields instead of ModuleFields here ? cc @sayden
  • Logstash - not tested yet
  • Beats - similar to kibana where it could be caused by documents missing elasticsearch.cluster.id property. Also it seems that we never had _mb tests for beats,

@klacabane
Copy link
Contributor Author

Going through Kibana views powered by the new templates there are missing aliases (on both agent and metricbeat-generated template) which fail queries, and wrong assumptions about the data structure of the metricbeat-generated data. MB queries expect a nested kibana object to retrieve details but it does not exist in main version (a similar property was deleted ~8months ago from metricbeat which is possibly the cause).

@klacabane
Copy link
Contributor Author

klacabane commented Dec 14, 2021

Got Beats to show up after fixing missing elasticsearch.cluster.id property on both stats/state metricsets and fixing some aliases as well. The list starts to grow, I'll cut a separate issue to track the local patches. These patches impact the SM server code, metricbeat and index templates.
The good thing about working backwards from the datastreams templates is that we'll also fix the integration packages by testing metricbeat standalone, that'll give us more time to implement functional tests :)

@klacabane klacabane changed the title Stack monitoring - standalone metricbeat 8.0 testing Stack monitoring - standalone metricbeat 8.0 compatibility Dec 14, 2021
@klacabane
Copy link
Contributor Author

Regarding Logstash section, we're looking for stats or logstash_stats metricset names but the metricbeat's logstash module only produces node and node_stats, did that also change since we initially implemented mb support ?

@jasonrhodes
Copy link
Member

@klacabane can we close this or convert it to "type: epic" if it's main goal is to track other work?

@matschaffer
Copy link
Contributor

matschaffer commented Jan 31, 2022

I think maybe it's time for a general Stack Monitoring 8.0 testing epic?

I have two issues (added to the description) that are still outstanding.

These aren't specifically related to the 7->8 metricbeat changes (I think), but it's hard to say "pass" until we get a clean manual test which we haven't had yet (sheet).

@klacabane
Copy link
Contributor Author

Let's close this once #123785 is fixed and move to a clean epic for the followup testing

@matschaffer
Copy link
Contributor

Cool. I opened #124312 for follow up testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services
Projects
None yet
Development

No branches or pull requests

4 participants