Skip to content

[9.1](backport #46358) [AutoOps] Allow AUTOOPS_ES_ prefix for environment variables#46369

Merged
pickypg merged 2 commits into
9.1from
mergify/bp/9.1/pr-46358
Sep 3, 2025
Merged

[9.1](backport #46358) [AutoOps] Allow AUTOOPS_ES_ prefix for environment variables#46369
pickypg merged 2 commits into
9.1from
mergify/bp/9.1/pr-46358

Conversation

@mergify
Copy link
Copy Markdown
Contributor

@mergify mergify Bot commented Sep 3, 2025

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.

Proposed commit message

Add expected support for AUTOOPS_ES_USERNAME, AUTOOPS_ES_PASSWORD, and AUTOOPS_ES_API_KEY. Support base64-encoded API Keys without re-encoding them.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

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).

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)
@mergify mergify Bot added the backport label Sep 3, 2025
@mergify mergify Bot requested a review from a team as a code owner September 3, 2025 15:09
@mergify mergify Bot assigned pickypg Sep 3, 2025
@botelastic botelastic Bot added the needs_team Indicates that the issue/PR needs a Team:* label label Sep 3, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Sep 3, 2025

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@github-actions github-actions Bot added bug release-note:skip The PR should be ignored when processing the changelog Team:Monitoring Stack Monitoring team Team:Opex labels Sep 3, 2025
@botelastic botelastic Bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Sep 3, 2025
@pickypg pickypg enabled auto-merge (squash) September 3, 2025 18:07
@pickypg pickypg merged commit 5c57c10 into 9.1 Sep 3, 2025
50 checks passed
@pickypg pickypg deleted the mergify/bp/9.1/pr-46358 branch September 3, 2025 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport bug release-note:skip The PR should be ignored when processing the changelog Team:Monitoring Stack Monitoring team Team:Opex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant