Skip to content

Es run tag#312

Merged
paigerube14 merged 1 commit intokrkn-chaos:mainfrom
paigerube14:es_run_tag
Mar 9, 2026
Merged

Es run tag#312
paigerube14 merged 1 commit intokrkn-chaos:mainfrom
paigerube14:es_run_tag

Conversation

@paigerube14
Copy link
Collaborator

Description

Adding ability to configure es run tag in config by environment variable

Documentation

  • Is documentation needed for this update?

If checked, a documentation PR must be created and merged in the website repository.

Related Documentation PR (if applicable)

Signed-off-by: Paige Patton <prubenda@redhat.com>
@qodo-code-review
Copy link

Review Summary by Qodo

Add Elasticsearch run tag environment variable configuration

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Add ES_RUN_TAG environment variable configuration support
• Enable run tag customization via config.yaml template
• Default to empty string if not specified
Diagram
flowchart LR
  ENV["Environment Variables<br/>ES_RUN_TAG"] -- "configure" --> ENVSH["env.sh<br/>Export ES_RUN_TAG"]
  ENVSH -- "reference" --> CONFIG["config.yaml.template<br/>run_tag field"]
  CONFIG -- "enable" --> ELASTIC["Elasticsearch<br/>Run Tag Setting"]
Loading

Grey Divider

File Changes

1. env.sh ⚙️ Configuration changes +1/-0

Add ES_RUN_TAG environment variable export

• Added ES_RUN_TAG environment variable export with empty string default
• Allows users to set run tag via environment configuration

env.sh


2. config.yaml.template ⚙️ Configuration changes +1/-0

Add run_tag field to elastic config section

• Added run_tag field to elastic configuration section
• References ES_RUN_TAG environment variable for dynamic configuration
• Enables run tag customization in Elasticsearch integration

config.yaml.template


Grey Divider

Qodo Logo

@qodo-code-review
Copy link

qodo-code-review bot commented Mar 5, 2026

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider


Remediation recommended

1. ES_RUN_TAG undocumented 🐞 Bug ✧ Quality
Description
This PR introduces ES_RUN_TAG and wires it into the generated config, but the repo’s “supported
parameters” documentation isn’t updated and currently documents different elastic env var names.
Users following the docs are likely to miss setting the run tag (or set the wrong vars), resulting
in untagged / hard-to-group ES runs.
Code

env.sh[29]

+export ES_RUN_TAG=${ES_RUN_TAG:=""}
Evidence
The PR adds ES_RUN_TAG and consumes it in config.yaml.template, and scenario entrypoints
generate the runtime config via envsubst from that template. However, the env var documentation
table does not mention ES_RUN_TAG and instead lists ELASTIC_SERVER/ELASTIC_INDEX, which do not
match the ES_* variables actually used by the templates, creating a clear usability/configuration
gap.

env.sh[23-33]
config.yaml.template[49-60]
pvc-scenario/run.sh[1-19]
docs/all_scenarios_env.md[41-46]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A new `ES_RUN_TAG` env var / `elastic.run_tag` config key was added, but the repo documentation of supported environment variables isn’t updated and currently documents different elastic env var names (`ELASTIC_SERVER`, `ELASTIC_INDEX`). This makes it likely that users won’t set the new run tag (or will set the wrong vars), reducing traceability/grouping in Elasticsearch.

## Issue Context
Runtime configs are generated via `envsubst` from `config.yaml.template`, so the env var names in docs need to match what the templates actually use.

## Fix Focus Areas
- docs/all_scenarios_env.md[13-47]
- env.sh[23-33]
- config.yaml.template[49-60]
- pvc-scenario/run.sh[16-19]

## Suggested doc change
- Add a row for `ES_RUN_TAG` (describe it as an optional tag appended/attached to ES records to group runs; default empty).
- Consider replacing/augmenting `ELASTIC_SERVER`/`ELASTIC_INDEX` with the actual variables used by this repo (`ENABLE_ES`, `ES_SERVER`, `ES_PORT`, `ES_USERNAME`, `ES_PASSWORD`, `ES_VERIFY_CERTS`, `ES_METRICS_INDEX`, `ES_ALERTS_INDEX`, `ES_TELEMETRY_INDEX`, `ES_RUN_TAG`).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@paigerube14 paigerube14 merged commit e6c1d63 into krkn-chaos:main Mar 9, 2026
3 checks passed
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