Skip to content

Conversation

Eliesmbr
Copy link
Contributor

@Eliesmbr Eliesmbr commented Oct 2, 2025

Description

Adds optional attachMetadata support to the ServiceMonitor resource.

Motivation

The attachMetadata field allows Prometheus to automatically attach Kubernetes metadata (like node labels) to scraped metrics, which is useful for better observability and filtering.

Changes

  • Added attachMetadata field to ServiceMonitor template
  • Field is optional and disabled by default (opt-in)
  • Added commented example in values.yaml
  • Bumped chart version from 0.5.0 to 0.6.0

Testing

  • Rendered template with helm template works correctly
  • Default behavior unchanged (backward compatible)
  • Works when attachMetadata.node: true is set

Checklist

  • DCO signed
  • Chart Version bumped
  • Title of the PR starts with chart name (e.g. [prometheus-smartctl-exporter])

Example Usage

serviceMonitor:
  attachMetadata:
    node: true

Adds optional attachMetadata field to ServiceMonitor spec to allow
attaching node metadata to scraped metrics. This is disabled by
default and must be explicitly enabled in values.yaml.

Signed-off-by: Elies Mabrouki <Eliesmbr@users.noreply.github.com>
@Eliesmbr Eliesmbr changed the title feat: add attachMetadata support to ServiceMonitor feat: [prometheus-smartctl-exporter] add attachMetadata support to ServiceMonitor Oct 2, 2025
@Eliesmbr Eliesmbr changed the title feat: [prometheus-smartctl-exporter] add attachMetadata support to ServiceMonitor [prometheus-smartctl-exporter] add attachMetadata support to ServiceMonitor Oct 2, 2025
Copy link
Contributor

@zeritti zeritti left a comment

Choose a reason for hiding this comment

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

Thank you, @Eliesmbr, for your PR, LGTM.

@zeritti zeritti merged commit 85072e8 into prometheus-community:main Oct 3, 2025
6 checks passed
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.

2 participants