-
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] Added deprecated tag to the advanced settings for xPack:defaultAdminEmail #70280
Conversation
Pinging @elastic/stack-monitoring (Team:Monitoring) |
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.
Nice work, thanks for the quick turnaround here.
The other thing this PR needs to do is add back in the functionality lost in the 7.7 NP migration PR, specifically the logic in https://github.com/elastic/kibana/blob/7.5/x-pack/legacy/plugins/monitoring/server/kibana_monitoring/collectors/get_settings_collector.js#L21. It's been changed in 7.7: https://github.com/elastic/kibana/blob/7.7/x-pack/plugins/monitoring/server/kibana_monitoring/collectors/get_settings_collector.ts#L15 in a breaking way (which was my bad there) and that needs to go back to the way it was.
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 think we also need to make changes to monitoring/deprecations.ts
so the specific deprecation block looks like:
(config, fromPath, logger) => {
const clusterAlertsEnabled = get(config, 'monitoring.cluster_alerts.enabled', true);
const emailNotificationsEnabled =
clusterAlertsEnabled &&
get(config, 'monitoring.cluster_alerts.email_notifications.enabled', true);
const updatedKey = get(config, `monitoring.${CLUSTER_ALERTS_ADDRESS_CONFIG_KEY}`);
const legacyKey = get(config, `xpack.monitoring.${CLUSTER_ALERTS_ADDRESS_CONFIG_KEY}`);
if (emailNotificationsEnabled && !updatedKey && !legacyKey) {
logger(
`Config key [${fromPath}.${CLUSTER_ALERTS_ADDRESS_CONFIG_KEY}] will be required for email notifications to work in 7.0."`
);
}
return config;
},
x-pack/plugins/monitoring/server/kibana_monitoring/collectors/get_settings_collector.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/monitoring/server/kibana_monitoring/collectors/get_settings_collector.ts
Outdated
Show resolved
Hide resolved
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.
Looking good! One small request and then I think we're g2g!
get(config, 'monitoring.cluster_alerts.email_notifications.enabled', true); | ||
const updatedKey = get(config, `monitoring.${CLUSTER_ALERTS_ADDRESS_CONFIG_KEY}`); | ||
const legacyKey = get(config, `xpack.monitoring.${CLUSTER_ALERTS_ADDRESS_CONFIG_KEY}`); | ||
if (emailNotificationsEnabled && !updatedKey && !legacyKey) { | ||
logger( | ||
`Config key [${fromPath}.${CLUSTER_ALERTS_ADDRESS_CONFIG_KEY}] will be required for email notifications to work in 7.0."` |
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.
We should update this to 8.0
too
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.
Nice catch!
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!
@elasticmachine merge upstream |
💚 Build SucceededBuild metrics
History
To update your PR or re-run it, just comment with: |
…defaultAdminEmail (#70280) (#71013) * Added deprecated tag to the advanced settings * Addressed code feedback * Code feedback * Code feedback * Fixed version Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
Backport: |
Fixes: #25439
This PR adds deprecation tag to the Advanced Settings config option, and also indicates the change in the docs