Repository navigation
Add deprecation warning log markers - #6908
Conversation
amartinezfayo
left a comment
There was a problem hiding this comment.
Thank you @officialasishkumar for this contribution!
I left some comments/suggestions.
| log.WithFields(logrus.Fields{ | ||
| telemetry.Alert: true, | ||
| telemetry.AlertType: telemetry.DeprecatedConfigAlertType, | ||
| }).Warn("ACME configuration within the bundle_endpoint is deprecated. Please use ACME configuration as part of the https_web profile instead.") |
There was a problem hiding this comment.
I think that we should also mark the adjacent case config.Profile == nil: warning right below, whose message reads "This will be fatal in a future release".
There was a problem hiding this comment.
Addressed in 32048d9: the adjacent config.Profile == nil warning now includes the deprecated config alert fields.
|
|
||
| When a breaking change is introduced to a plugin interface, existing plugins compiled against the old interface will still continue to function for one minor version release cycle to give operators time to adopt requisite changes. SPIRE will log warnings to make operators aware of the change. | ||
|
|
||
| #### Deprecation Log Markers |
There was a problem hiding this comment.
I would place this subsection at a higher level, since the content covers both configuration deprecations (server and agent) and plugin service deprecations. Nesting it under ### SPIRE Plugin Compatibility may understate the scope. Moving it up to a sibling of SPIRE Plugin Compatibility, or to its own top-level section before ## Supported Upgrade Paths, might better match the breadth of what the alerts cover.
There was a problem hiding this comment.
Addressed in 32048d9: moved the deprecation log marker note up to its own sibling section.
| Activate = "activate" | ||
|
|
||
| // Alert tags log events that should be easy for operators to alert on. | ||
| Alert = "alert" |
There was a problem hiding this comment.
I think the new Alert, AlertType, DeprecatedConfigAlertType, and DeprecatedServiceAlertType constants fit more naturally in the "Attribute metric tags or labels" section that already houses DeprecatedServiceName, rather than the "Action metric tags or labels" block here. The new names describe attributes of a log event, not actions taken, and grouping them next to DeprecatedServiceName would keep deprecation-related constants together.
There was a problem hiding this comment.
Addressed in 32048d9: moved the alert/deprecation constants next to the attribute labels.
d9e5c24 to
32048d9
Compare
| DatabaseType = "db_type" | ||
|
|
||
| // Alert tags log events that should be easy for operators to alert on. | ||
| Alert = "alert" |
There was a problem hiding this comment.
As I read the latest revision, the previous doc/upgrading.md addition that introduced a "Deprecation Log Markers" subsection appears to have been removed entirely rather than relocated.
There was a problem hiding this comment.
Restored the Deprecation Log Markers section in doc/upgrading.md in 2af0dbc.
|
|
||
| // Append functionality related to appending some element (such as part of a bundle); | ||
| // should be used with other tags to add clarity | ||
| Append = "append" |
There was a problem hiding this comment.
nit: Looks like the blank lines between Activate = "activate" and the // Append comment, and between Attest = "attest" and the // Create comment were removed unintentionally when the alert constants were relocated out of this section?
There was a problem hiding this comment.
Restored the blank lines around those telemetry constants in 2af0dbc.
| log.WithFields(logrus.Fields{ | ||
| telemetry.Alert: true, | ||
| telemetry.AlertType: telemetry.DeprecatedConfigAlertType, | ||
| }).Warn("Bundle endpoint is configured but has no profile set, using https_spiffe as default; please configure a profile explicitly. This will be fatal in a future release.") |
There was a problem hiding this comment.
It could be worth extending the existing "bundle endpoint has acme" pattern with an analogous test case that exercises the no-profile branch and asserts the new alert and alert_type=deprecated_config fields appear on its warning.
There was a problem hiding this comment.
Added the no-profile warning assertion for the deprecation alert fields in 2af0dbc.
32048d9 to
2af0dbc
Compare
amartinezfayo
left a comment
There was a problem hiding this comment.
Thank you @officialasishkumar!
|
@officialasishkumar could you fix DCO so we can have this merged? |
Signed-off-by: Asish Kumar <[email protected]>
Signed-off-by: Asish Kumar <[email protected]>
Signed-off-by: Asish Kumar <[email protected]>
Head branch was pushed to by a user without write access
2af0dbc to
c26cf0f
Compare
|
Signed off the PR commits in c26cf0f. |
* Add deprecation warning log markers Signed-off-by: Asish Kumar <[email protected]> * Address deprecation marker review feedback Signed-off-by: Asish Kumar <[email protected]> * Address deprecation marker review feedback Signed-off-by: Asish Kumar <[email protected]> --------- Signed-off-by: Asish Kumar <[email protected]>
Pull Request check list
Affected functionality
Deprecation warning logs emitted by agent and server configuration handling, and deprecated plugin service binding.
Description of change
Adds structured alert fields to deprecation warnings so operators can reliably find and alert on them. Configuration deprecation warnings now include
alert=trueandalert_type=deprecated_config; deprecated plugin service warnings includealert=trueandalert_type=deprecated_service.The upgrade guide documents these fields, and focused tests cover the affected warning sites.
Which issue this PR fixes
fixes #5905