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

Do Not Overwrite collectors #1616

Open
naveensrinivasan opened this issue Jan 3, 2024 · 1 comment
Open

Do Not Overwrite collectors #1616

naveensrinivasan opened this issue Jan 3, 2024 · 1 comment

Comments

@naveensrinivasan
Copy link
Contributor

naveensrinivasan commented Jan 3, 2024

Do not overwrite collectors

func RegisterDocumentCollector(c Collector, collectorType string) error {
if _, ok := documentCollectors[collectorType]; ok {
documentCollectors[collectorType] = c
return fmt.Errorf("%w: %s", ErrCollectorOverwrite, collectorType)
}
documentCollectors[collectorType] = c
return nil
}

          re your [comment](https://github.com/guacsec/guac/pull/1500#issuecomment-1846097866) on this breaking things - is this behavior of overriding being used anywhere besides in tests? My initial thought is to add a comment for registration of collector to say that one should NOT override a registration (and should only be done for testing purposes). And then can you open an issue referencing this thread.

Originally posted by @lumjjb in #1500 (comment)

@arorasoham9
Copy link
Contributor

arorasoham9 commented Feb 1, 2024

Could I get some more information on what is required to be done here?

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

No branches or pull requests

2 participants