[Monitoring] Kibana settings api#21100
Conversation
💔 Build Failed |
|
Functionally this LGTM. I tested it with elastic/beats#7664 and it works as expected. Will review code shortly. |
| const settings = await settingsCollector.fetch(callCluster); | ||
| const uuid = await getClusterUuid(callCluster); | ||
|
|
||
| console.log('uuid', uuid); |
ycombinator
left a comment
There was a problem hiding this comment.
Just a minor comment, and then LGTM.
💔 Build Failed |
| */ | ||
|
|
||
| import { wrap as wrapError } from 'boom'; | ||
| import { getKibanaInfoForStats } from '../../../../../../../src/server/status/lib'; |
There was a problem hiding this comment.
Looks like CI is failing on this line:
15:25:10 │ debg error [22:25:10.553] [fatal] Error: Cannot find module '../../../../../../../src/server/status/lib'
15:25:10 │ debg at Function.Module._resolveFilename (module.js:547:15)
15:25:10 │ debg at Function.Module._load (module.js:474:25)
15:25:10 │ debg at Module.require (module.js:596:17)
15:25:10 │ debg at require (internal/module.js:11:18)
15:25:10 │ debg at Object.<anonymous> (/var/lib/jenkins/workspace/elastic+kibana+pull-request+multijob-x-pack/kibana/build/kibana/node_modules/x-pack/plugins/xpack_main/server/routes/api/v1/settings.js:8:1)
...
💚 Build Succeeded |
| } | ||
| }); | ||
| } catch(err) { | ||
| req.log(['error'], err); // FIXME doesn't seem to log anything useful if ES times out |
There was a problem hiding this comment.
Was this FIXME for addressing in this PR itself or a follow up PR?
There was a problem hiding this comment.
Good question. It's a comment copied over from the other api endpoint. Let's say it will be addressed in a follow up PR
There was a problem hiding this comment.
I suspect the follow PR would need to address this problem everywhere
ycombinator
left a comment
There was a problem hiding this comment.
Tested with elastic/beats#7664. LGTM.
💔 Build Failed |
💔 Build Failed |
💚 Build Succeeded |
|
@simianhacker Have some cycles to review this for me? |
simianhacker
left a comment
There was a problem hiding this comment.
LGTM... I had a question about the tests. Right now you're just making sure at least one cluster show's up but that doesn't really test if we support more then one.
| } | ||
| }); | ||
| } catch(err) { | ||
| req.log(['error'], err); // FIXME doesn't seem to log anything useful if ES times out |
There was a problem hiding this comment.
I suspect the follow PR would need to address this problem everywhere
| .get('/api/settings') | ||
| .set('kbn-xsrf', 'xxx') | ||
| .expect(200); | ||
| expect(body.cluster_uuid.length > 0).to.eql(true); |
There was a problem hiding this comment.
Shouldn't this be more then 1 if we expect multiple?
There was a problem hiding this comment.
Yup, good point!
|
FYI... You can probably merge this once it's green. |
💚 Build Succeeded |
* Kibana settings api * Use different version of this utility * Adding settings api test * Fix these tests * Update test
|
Backport: 6.x: cf03af7 |
Resolves #7621. Depends on elastic/kibana#21100. X-Pack Monitoring of Kibana requires two types of documents in the `.monitoring-kibana-*` indices: `kibana_stats` and `kibana_settings`. We made Metricbeat's `kibana/stats` metricset index `kibana_stats` documents into `.monitoring-kibana-*` in #7525. This PR makes the same metricset index `kibana_settings` documents into `.monitoring-kibana-*`.
Resolves #7621. Depends on elastic/kibana#21100. X-Pack Monitoring of Kibana requires two types of documents in the `.monitoring-kibana-*` indices: `kibana_stats` and `kibana_settings`. We made Metricbeat's `kibana/stats` metricset index `kibana_stats` documents into `.monitoring-kibana-*` in #7525. This PR makes the same metricset index `kibana_settings` documents into `.monitoring-kibana-*`. (cherry picked from commit 2af5ab9)
| return esArchiver.unload(archive); | ||
| }); | ||
|
|
||
| it('should load multiple clusters', async () => { |
There was a problem hiding this comment.
description should be different :)
Resolves #20903
Summary
This PR exposes an api that includes nearly the same information from the
kibana_settingsmonitoring docs through an api endpoint for consumption through Metricbeat.The api endpoint is:
/api/settingsand the response looks like:Testing
To test, you'll need to grab sample
kibana_settingsmonitoring document:Compare the response from the above (within the
kibanafield) with thekibanafield from the api response and ensure they match.