Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add possibility to set a bearer token secret in ServiceMonitor #115

Merged
merged 2 commits into from
Mar 9, 2025

Conversation

andibraeu
Copy link
Contributor

This PR adds support for bearer token authentication in the ServiceMonitor configuration. This enhancement allows users to secure their Prometheus metrics endpoint with token-based authentication.

Changes made:

  • Added bearerToken configuration with secretName and secretKey properties to the serviceMonitor section in values.yaml
  • Updated the ServiceMonitor template to include bearer token authentication when configured
  • Added documentation in the README explaining how to use the bearer token feature
  • Created a test configuration to validate the implementation

Example usage:

serviceMonitor:
  enabled: true
  scrapeInterval: 30s
  labels:
    release: prometheus
  bearerToken:
    secretName: "prometheus-token"
    secretKey: "token"

This enhancement improves security for Home Assistant metrics collection while maintaining backward compatibility with existing configurations.

Signed-off-by: Andreas Bräu <ab@andi95.de>
Signed-off-by: Andreas Bräu <ab@andi95.de>
@andibraeu
Copy link
Contributor Author

Hi @pajikos
can you review this PR, please?

@pajikos
Copy link
Owner

pajikos commented Mar 9, 2025

Hi @andibraeu, thank you for both of your PRs. Today I returned from vacation.

@pajikos pajikos closed this Mar 9, 2025
@pajikos pajikos reopened this Mar 9, 2025
@pajikos pajikos merged commit e1bc5f7 into pajikos:main Mar 9, 2025
2 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.

None yet

2 participants