-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Write to .monitoring index on elasticsearch if xpack.enabled is true on standalone metricbeat #28365
Write to .monitoring index on elasticsearch if xpack.enabled is true on standalone metricbeat #28365
Conversation
This pull request does not have a backport label. Could you fix it @sayden? 🙏
NOTE: |
e163621
to
138b247
Compare
Pinging @elastic/integrations (Team:Integrations) |
Pinging @elastic/stack-monitoring (Stack monitoring) |
/test |
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.
lgtm
I gave this a try today hoping it'd get stack monitoring working correctly on kibana+metricbeat master, but it looks like the indices are missing mappings for at least Without that I'm not sure how we should query for ES cluster stats docs which is currently what the UI uses to pull a list of ES clusters. Is there another issue tracking fixing that or should I open one? |
Looks like also the kibana mapping has |
@matschaffer can you explain what is your expectation and what doesn't work? To give some context, there's a lot of mappings that might or might not have a related data. This is because, according to Kibana folks on SM UI, it was impossible to know in Kibana which fields were being accessed so I had to map every possible field "just in case". Partly because many fields were being accessed out of the query (Kibana get the _doc and Kibana knows structure of each doc) Modules also have a Along the 15-20 metricsets of the 4 modules, I'd expect less than 10 possible mapping errors. Which is very optimistic knowing that I had to manually alias around a thousand of fields to a mapping of around a 1000 of ECS fields. I hope this clarification helps 🙂 |
…on standalone metricbeat (elastic#28365) (cherry picked from commit 462f42f)
@sayden I was expecting to be able to load the stackmonitoring UI using metricbeat from master monitoring kibana main via the config in https:/elastic/beats/blob/master/metricbeat/modules.d/kibana-xpack.yml.disabled This is similar to how I might use metricbeat 7.15 to monitor kibana. Before this PR, the data would land in I'm wondering if we have an issue to get metricbeat shipping the 7.15 doc structure again that I should be following (cc @jasonrhodes incase he has context on this) |
FWIW I expect this PR to put the data in .monitoring and to install aliases for the relevant .monitoring-{product}-mb index template(s). That may mean that to test it you have to trigger a rollover so a new index will be created with the right mappings. Users wouldn't have to worry about this bc a new Kibana version would start writing to a new versioned index IIUC. @sayden can you confirm/help @matschaffer confirm this works? |
Just testing on elastic/kibana@fca8cbf and 84e668c locally. Fresh I see data in the expected indices: The SM clusters API queries like this:
But doesn't get any hits. I can see the mapping at least has probably enough fields:
But the structure of the docs in the index are quite different. Here's a random example. I can't actually pull the most recent since it uses
|
If I add these fields to the index mapping directly, I can get something that works sort of like the cluster API query:
|
Mind you I'm just working on assumptions here. If the idea is that metricbeat should be publishing this way, and SM UI needs updates that's fine. Just not sure where that work is filed. Though it does seem strange that the document structure doesn't line up with the index mapping very well. |
This all should be powered by field aliases applied to these mappings, so all of our investigation should be pointed at that. No Stack Monitoring UI changes are expected, but source data also won't look exactly right all the time. Queries that rely on fields for aggregations, filters, etc. should work though, because the aliases should be in place. If the UI doesn't load with these changes, we still have work to do, because I expected that it would. |
@sayden @masci can you all confirm that this PR is meant to resolve the updated AC of #26480 ? If so, can we link them in the description? Thanks! I will help @matschaffer and team dig into this to see if it does what I expected for powering the UI in 8.0/main. |
@jasonrhodes gotcha. I didn't see any field aliases in my testing and SM UI did not load. Seems like a disconnect somewhere. Good to know that SM UI code isn't expected to change so we'll need to work out what's up on the beats end. |
Hey y'all, per @andresrc 's request I re-ran the test in #28365 (comment) and got the same results on latest master/main for beats & kibana. Then I also tested with But I can't find any I also recorded a video, I'll send that to the email thread we have going on this issue as well. |
Just wanted to record that I tried an override template:
This fails because the |
Updating this ticket since we were talking here about missing mappings/aliases: I spoke with @jbaiera and we are going to let Elasticsearch install these mappings/aliases for us, targeted only at the Metricbeat standalone indices. We just need to provide ES with the JSON files for the templates we need (they apparently need to be component templates composed into an index template since these .monitoring indices will really be data streams, but the ES APIs for adding templates at start up allows for component templates). @sayden is working now on getting the JSON together for this and will provide it as soon as it's ready. ping @matschaffer / @klacabane |
…on standalone metricbeat (#28365) (#29314) (cherry picked from commit 462f42f) Co-authored-by: Mario Castro <[email protected]>
What does this PR do?
This PR implements the possibility to write to
.monitoring
indices in Stack Monitoring modules when usingxpack.enabled: true
. Whenfalse
it will write intometricbeat-*
unless it's using Agent, that the index will be a data-stream.CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Closes #25043