-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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] Kibana settings api #21100
[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); |
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.
Debugging statement.
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this FIXME
for addressing in this PR itself or a follow up PR?
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect the follow PR would need to address this problem everywhere
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.
Tested with elastic/beats#7664. LGTM.
💔 Build Failed |
💔 Build Failed |
💚 Build Succeeded |
@simianhacker Have some cycles to review this for me? |
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 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be more then 1 if we expect multiple?
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.
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 elastic#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 elastic#7525. This PR makes the same metricset index `kibana_settings` documents into `.monitoring-kibana-*`. (cherry picked from commit 2af5ab9)
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
description should be different :)
Resolves #20903
Summary
This PR exposes an api that includes nearly the same information from the
kibana_settings
monitoring docs through an api endpoint for consumption through Metricbeat.The api endpoint is:
/api/settings
and the response looks like:Testing
To test, you'll need to grab sample
kibana_settings
monitoring document:Compare the response from the above (within the
kibana
field) with thekibana
field from the api response and ensure they match.