[9.1](backport #46358) [AutoOps] Allow AUTOOPS_ES_ prefix for environment variables#46369
Merged
Conversation
This adds support for three expected environment variables to be supplied by service usage of AutoOps wrapping the Elasticsearch metricset. This adds support for these in addition to the existing key - `AUTOOPS_ES_USERNAME` (or `ELASTICSEARCH_READ_USERNAME`) - `AUTOOPS_ES_PASSWORD` (or `ELASTICSEARCH_READ_PASSWORD`) - `AUTOOPS_ES_API_KEY` (or `ELASTICSEARCH_API_KEY`) This also adds support for the API Key to be supplied as a Base64 encoded value, which will be used directly. This is detected by looking for the `:` that separates the existing `id:key` value, then encoding it if it detects that and, otherwise, using it directly. (cherry picked from commit b0f8ee7)
Contributor
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
pickypg
approved these changes
Sep 3, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This adds support for three expected environment variables to be supplied by service usage of AutoOps wrapping the Elasticsearch metricset.
This adds support for these in addition to the existing key
AUTOOPS_ES_USERNAME(orELASTICSEARCH_READ_USERNAME)AUTOOPS_ES_PASSWORD(orELASTICSEARCH_READ_PASSWORD)AUTOOPS_ES_API_KEY(orELASTICSEARCH_API_KEY)This also adds support for the API Key to be supplied as a Base64 encoded value, which will be used directly. This is detected by looking for the
:that separates the existingid:keyvalue, then encoding it if it detects that and, otherwise, using it directly.Proposed commit message
Add expected support for
AUTOOPS_ES_USERNAME,AUTOOPS_ES_PASSWORD, andAUTOOPS_ES_API_KEY. Support base64-encoded API Keys without re-encoding them.Checklist
Disruptive User Impact
None. This retains backward compatibility while expanding compatibility.
How to test this PR locally
Attempt to use the environment variables specified to connect to Elasticsearch. When using the API Key, try to use both the Base64-encoded value and the non-Base64 encoded value.
Related issues
Use cases
Allow users to copy/paste the API Key that is provided in most scenarios (Base64 encoded) and allow AutoOps to specify more appropriately named environment variables.
This is an automatic backport of pull request #46358 done by [Mergify](https://mergify.com).