[redisstorageextension] allow redis key prefix to be specified in config #37677
+80
−9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The purpose of this PR is to allow the user to specify the redis key prefix. The lack of this feature has become problematic when using multiple replicas in a kubernetes cluster - until now, the key prefix has been based on the storage extension and receiver names, which are the same for each replica because they share the same configuration and therefore overwrite the same key in redis. With the changes in this PR, the user can specify the prefix as an environmental variable (which can have different value for each replica), for example.
Testing
opentelemetry-collector-contrib (0.118.0) was built with this change and tested on a kubernetes cluster
Config used for testing:
Documentation
Updated README.md to add new config parameter.