Skip to content

Conversation

@hsmatulis
Copy link

@hsmatulis hsmatulis commented Jun 27, 2025

This PR introduces a new package, secrets, to prometheus/common. This package provides a unified way to handle secrets within configuration files for Prometheus and its ecosystem components. It is designed to be extensible and observable. See the proposal here

@hsmatulis hsmatulis force-pushed the main branch 3 times, most recently from cf118e6 to 24ec0f7 Compare July 7, 2025 11:07
@hsmatulis hsmatulis force-pushed the main branch 19 times, most recently from 694bf26 to ef24c3d Compare October 2, 2025 07:40
@hsmatulis hsmatulis changed the title feat(secrets): Introduce new package for dynamic secret management feat(secrets): Add new secrets management package Oct 2, 2025
@hsmatulis hsmatulis marked this pull request as ready for review October 2, 2025 07:42
@hsmatulis
Copy link
Author

hsmatulis commented Oct 2, 2025

@pintohutch @bernot-dev @bwplotka PTAL, should be ready!

@bwplotka bwplotka self-requested a review October 8, 2025 15:15
Copy link
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

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

Thanks, amazing work!

Generally, it's great - maybe first big question is if we want SecretField to store so much state or do we want to move some of this state to manager (or and providers). This might be more composable and easier to reason about. Prometheus discovery is doing some of this. I mentioned one idea (A) 1 and 2 in comments.

However, it's not a blocker, even in the current state, I would say we could try this out on Prometheus (and someone might try on AM side!). What matters is that I see a clean YAML surface format, clean code, idiomatic struct reflection to find fields and healthy amount of test, so amazing! With this we can iterate.

No matter if you want to try (A) or skip it for now, I think I would try to check before merging:

Then I would like to review in more depth the manager code, but generally... we could start with this! 🎉 Thanks!

Copy link
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

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

Looks solid, thanks!

Still some few comments to address, but overall looks close to be merged!

@hsmatulis hsmatulis force-pushed the main branch 2 times, most recently from 37e45e0 to 3abfb21 Compare November 20, 2025 06:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 21 out of 21 changed files in this pull request and generated 10 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +30 to +35
func (fp *fileProvider) FetchSecret(_ context.Context) (string, error) {
content, err := os.ReadFile(fp.path)
if err != nil {
return "", err
}
return string(content), nil
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

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

The file content is read into memory as a string without any size limits. If a user mistakenly points to a very large file, this could consume excessive memory. Consider adding a reasonable size limit (e.g., a few MB) and returning an error if the file exceeds that limit to prevent potential denial of service through memory exhaustion.

Copilot uses AI. Check for mistakes.
@hsmatulis hsmatulis force-pushed the main branch 14 times, most recently from 2e49c81 to 07e1d69 Compare January 5, 2026 13:01
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