Skip to content

Add deprecation warning log markers - #6908

Merged
amartinezfayo merged 3 commits into
spiffe:mainfrom
officialasishkumar:fix/deprecation-log-markers
May 26, 2026
Merged

amartinezfayo merged 3 commits into
spiffe:mainfrom
officialasishkumar:fix/deprecation-log-markers

Conversation

@officialasishkumar

Copy link
Copy Markdown
Contributor

Pull Request check list

  • Commit conforms to CONTRIBUTING.md?
  • Proper tests/regressions included?
  • Documentation updated?

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=true and alert_type=deprecated_config; deprecated plugin service warnings include alert=true and alert_type=deprecated_service.

The upgrade guide documents these fields, and focused tests cover the affected warning sites.

Which issue this PR fixes

fixes #5905

@amartinezfayo amartinezfayo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 32048d9: the adjacent config.Profile == nil warning now includes the deprecated config alert fields.

Comment thread doc/upgrading.md

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 32048d9: moved the deprecation log marker note up to its own sibling section.

Comment thread pkg/common/telemetry/names.go Outdated
Activate = "activate"

// Alert tags log events that should be easy for operators to alert on.
Alert = "alert"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 32048d9: moved the alert/deprecation constants next to the attribute labels.

@officialasishkumar
officialasishkumar force-pushed the fix/deprecation-log-markers branch from d9e5c24 to 32048d9 Compare May 13, 2026 07:04
DatabaseType = "db_type"

// Alert tags log events that should be easy for operators to alert on.
Alert = "alert"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the no-profile warning assertion for the deprecation alert fields in 2af0dbc.

@officialasishkumar
officialasishkumar force-pushed the fix/deprecation-log-markers branch from 32048d9 to 2af0dbc Compare May 20, 2026 07:07

@amartinezfayo amartinezfayo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @officialasishkumar!

@amartinezfayo amartinezfayo added this to the 1.15.1 milestone May 20, 2026
@amartinezfayo
amartinezfayo enabled auto-merge May 20, 2026 11:42
@amartinezfayo

Copy link
Copy Markdown
Member

@officialasishkumar could you fix DCO so we can have this merged?

auto-merge was automatically disabled May 24, 2026 08:22

Head branch was pushed to by a user without write access

@officialasishkumar
officialasishkumar force-pushed the fix/deprecation-log-markers branch from 2af0dbc to c26cf0f Compare May 24, 2026 08:22
@officialasishkumar

Copy link
Copy Markdown
Contributor Author

Signed off the PR commits in c26cf0f.

@amartinezfayo
amartinezfayo enabled auto-merge May 26, 2026 18:25
@amartinezfayo
amartinezfayo added this pull request to the merge queue May 26, 2026
Merged via the queue into spiffe:main with commit cfdcbb2 May 26, 2026
50 checks passed
MikeZappa87 pushed a commit to MikeZappa87/spire that referenced this pull request May 29, 2026
* 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]>
@c4rlo c4rlo mentioned this pull request Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a log marker for deprecation warnings

2 participants