Skip to content

Conversation

@aslafy-z
Copy link
Collaborator

@aslafy-z aslafy-z commented Nov 26, 2025

This change fixes inconsistent service naming and metadata handling across the metrics reconciler functions in fluentd, fluentbit and syslogng. It also refactors the code to reuse object metadata to ensure consistent behaviour in both present and absent states.

  • For all three components (Fluentd, Fluentbit, SyslogNG), metrics-related services and buffer-metrics services now use a single objectMetadata variable initialized at the top of each reconciler function. This replaces repeated calls to *ObjectMeta(...) when building the Service or ServiceMonitor objects.
  • This ensures that when disabling metrics or buffer-volume metrics, the correct Service/ServiceMonitor (with the "-metrics" or "-buffer-metrics" suffix) is targeted for deletion. Previously, the “absent” branch sometimes used a legacy suffix (e.g. "-monitor"), causing the actual metrics Service to be orphaned — this could break metrics cleanup and cause stale or duplicated resources.
  • This resolves bugs where metrics services were not cleaned up or incorrectly named after disabling metrics or buffer-volume metrics, and helps avoid resource accumulation or inconsistency in deployments using any of fluentd, fluentbit or syslogng components.

Copy link
Member

@csatib02 csatib02 left a comment

Choose a reason for hiding this comment

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

LGTM!

Signed-off-by: Zadkiel AHARONIAN <hello@zadkiel.fr>
Signed-off-by: Zadkiel AHARONIAN <hello@zadkiel.fr>
Signed-off-by: Zadkiel AHARONIAN <hello@zadkiel.fr>
… metadata

Signed-off-by: Zadkiel AHARONIAN <hello@zadkiel.fr>
@csatib02 csatib02 force-pushed the fix/metrics-name-meta branch from 4891354 to 45b3a37 Compare November 27, 2025 08:51
@csatib02 csatib02 merged commit 4045dd8 into master Nov 27, 2025
39 of 41 checks passed
@csatib02 csatib02 deleted the fix/metrics-name-meta branch November 27, 2025 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants