Skip to content

Conversation

rajagopalanand
Copy link

@rajagopalanand rajagopalanand commented Jun 5, 2025

This is for receivers:

*** Please review https://github.com/amazon-contributing/alertmanager/pull/8/files ***

  • Uses a pattern similar to service discovery
  • This will be used in Cortex as follows in ApplyConfig(..) in alertmanager.go - Will submit a separate cherry-pick PR for that. There are more changes than shown below
	am.secretsProviderRegistry = secrets.NewSecretsProviderRegistry(util_log.GoKitLogToSlog(log.With(am.logger, "component", "secrets_provider")), am.registry)
	// currently only one secrets provider is supported
	am.secretsProviderRegistry.Register(providers.AMPAWSSecretsManagerSecretProviderDiscoveryConfig{
		UserID: userID,
	})
	am.secretsProviderRegistry.Init() //initialize the registry
  • There is one SecretsProviderRegistry per tenant
  • Each SecretsProviderRegistry has 1..n SecretProviders but only 1 provider of each type. AWSSecretsManagerProvider, InlineProvider are examples of provider. A registry can contain many providers but only one AWSSecretsManagerProvider and one InlineProvider (and one each of other types in the future)
  • Each SecretProvider is free to implement however but in this implementation AWSSecretsManagerProvider maintains 1 SecretsFetcher per SecretARN. I chose to do it this way because each SecretARN's lifecycle can be different and the AWSSecretsManagerProvider manages the lifecycle of all the fetchers. For example, if the same ARN is registered twice, AWSSecretsManagerProvider will only create 1 SecretsFetcher

Signed-off-by: Anand Rajagopal <anrajag@amazon.com>
@rajagopalanand rajagopalanand force-pushed the receivers-gs-no-pointer branch 10 times, most recently from 5e158d2 to 52f505d Compare June 9, 2025 14:45
Signed-off-by: Anand Rajagopal <anrajag@amazon.com>
@rajagopalanand rajagopalanand force-pushed the receivers-gs-no-pointer branch from 52f505d to e355ec6 Compare June 11, 2025 01:36
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.

1 participant