Skip to content

Report deprecated fields more clearly #5681

@simonpasquier

Description

@simonpasquier

What is missing?

While the operator prints warning logs when it notices usage of deprecated fields in custom resources, it's hard for users to notice it. In particular when they don't have access to the operator's logs (e.g. they may be able to provision Prometheus resources but the operator is managed by another team).

Suggested improvements:

  • Report usage of deprecated fields in the Reconciled condition. The condition's status should be True but the reason and message fields can convey additional information (such as reason: DeprecatedFieldsInUse and message: Field xxx is deprecated and may be removed in a future version, please use yyy instead.).
  • Report a gauge metric per resource signaling how many deprecated fields are used.
  • Create an alert from the metric.

We also need to make sure that all deprecated fields are reported (for instance prometheusRulesExcludedFromEnforce is not).

Why do we need it?

Better feedback to users who are referencing fields that are being deprecated.

Environment

  • Prometheus Operator version:

    Insert image tag or Git SHA here

Anything else we need to know?:

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions