-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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] Add flag to enable/disable CCR monitoring UI #28840
Changes from 7 commits
9322571
483d8dc
e3814e6
e1b6543
9ecd542
76add94
93d781e
23d043d
f1c196f
2c30b0a
929ed87
846ae70
563b5fc
0fa1734
a1389c2
06b2f66
2b458a3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { get } from 'lodash'; | ||
|
||
export function handleResponse(response) { | ||
return get(response.defaults, 'xpack.ccr.enabled') === 'true'; | ||
} | ||
|
||
export async function checkCcrEnabled(req) { | ||
const { callWithRequest } = req.server.plugins.elasticsearch.getCluster('monitoring'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this the right cluster to check against? Or is it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah crap, of course! We can't just call this API against the production or monitoring clusters 🤦♂️. What we need is to know via monitoring data if CCR is enabled or disabled on a particular production cluster. I'm not sure we have the data on whether CCR is enabled or not in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We will automatically start collecting this information in |
||
const response = await callWithRequest(req, 'transport.request', { | ||
method: 'GET', | ||
path: '/_cluster/settings?include_defaults', | ||
filter_path: [ | ||
'defaults.xpack.ccr.enabled', | ||
] | ||
ycombinator marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}); | ||
|
||
return handleResponse(response); | ||
} |
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.
Did you mean to leave this in? :)
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.
Not at all! Thanks!