Skip to content

Fetch and store target cluster meta info at benchmark start#2095

Merged
inqueue merged 6 commits into
masterfrom
copilot/fetch-store-meta-info
Apr 16, 2026
Merged

Fetch and store target cluster meta info at benchmark start#2095
inqueue merged 6 commits into
masterfrom
copilot/fetch-store-meta-info

Conversation

Copilot AI commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Rally contacts the target cluster at benchmark start but discards useful identifying metadata. This adds target_id, target_platform, and target_auth_type to every indexed document, making it easier to correlate race results with their target clusters without manual tagging.

Changes

esrally/telemetry.pyClusterEnvironmentInfo

  • Added optional client_options parameter to __init__
  • In on_benchmark_start, extracts and stores three new meta fields via add_meta_info(MetaInfoScope.cluster, ...) — the same mechanism as user tags — so they appear in the meta.* field of every telemetry document:
    • target_id — project ID (serverless), cluster ID (ECH), or configured cluster name (on-prem)
    • target_platform"serverless" (via build_flavor), "hosted" (via x-found-handling-cluster response header from ECH), or "on-prem" (default)
    • target_auth_type"api_key" or "basic" derived from client options; omitted if neither is configured

esrally/driver/driver.py

  • prepare_telemetry() retrieves the default cluster's raw client options from config and passes them to ClusterEnvironmentInfo
  • Driver.prepare_benchmark() computes target_platform (including hosted detection via response headers) and target_auth_type while the API response is fresh, storing them on DriverActor
  • PreparationComplete message extended with target_id, target_platform, and target_auth_type

esrally/racecontrol.py

  • on_preparation_complete() receives and sets target_id, target_platform, and target_auth_type on the Race object

esrally/metrics.pyRace

  • Added target_id, target_platform, and target_auth_type fields
  • to_result_dicts() includes target-id, target-platform, and target-auth-type as top-level fields alongside distribution-version and distribution-flavor in race result documents

tests/telemetry_test.py

  • Updated existing assertions to include the new target_platform call
  • Added tests for target_id storage, ECH header detection, api_key/basic auth type detection, and the no-auth case

Copilot AI and others added 2 commits April 8, 2026 16:25
- cluster_name from GET / response (project ID for serverless, cluster ID for ECH, cluster name for on-prem)
- target_platform: serverless/hosted/on-prem (hosted detected via x-found-handling-cluster response header)
- target_auth_type: api_key or basic (from client options)
- Pass client options to ClusterEnvironmentInfo from prepare_telemetry
- Add new tests for cluster_name, target_platform, and target_auth_type

Agent-Logs-Url: https://github.com/elastic/rally/sessions/3c4bd014-8eba-47d8-9ef7-7fdf59a882c4

Co-authored-by: gareth-ellis <14981026+gareth-ellis@users.noreply.github.com>
…_auth tuple test

Agent-Logs-Url: https://github.com/elastic/rally/sessions/3c4bd014-8eba-47d8-9ef7-7fdf59a882c4

Co-authored-by: gareth-ellis <14981026+gareth-ellis@users.noreply.github.com>
Copilot AI changed the title [WIP] Fetch and store meta info for target cluster Fetch and store target cluster meta info at benchmark start Apr 8, 2026
Copilot AI requested a review from gareth-ellis April 8, 2026 16:29
@gareth-ellis gareth-ellis requested a review from inqueue April 8, 2026 16:46

@gareth-ellis gareth-ellis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As well as this, could you also add the three values (cluster id / cluster name) (you could refer to this as target_id), target_platform and target_auth_type to each document that is indexed? the same way we add user tags, meta.* etc.

Copilot AI and others added 2 commits April 8, 2026 17:10
…ace results

- Rename cluster_name -> target_id in ClusterEnvironmentInfo meta info (telemetry docs)
- Extend PreparationComplete message to carry target_id, target_platform, target_auth_type
- Compute target_id, target_platform, target_auth_type in DriverActor._after_track_prepared()
- Pass new fields through BenchmarkCoordinator.on_preparation_complete() to Race object
- Add target_id, target_platform, target_auth_type to Race class and to_result_dicts()
  so they appear as top-level fields in race result documents alongside distribution-version

Agent-Logs-Url: https://github.com/elastic/rally/sessions/1c4b9405-a245-4d6e-95f0-8358de160d35

Co-authored-by: gareth-ellis <14981026+gareth-ellis@users.noreply.github.com>
…ation to prepare_benchmark

- Compute target_platform and target_auth_type in Driver.prepare_benchmark() where
  cluster_details response object is freshly available (avoids fragile getattr in _after_track_prepared)
- Use .all_client_options.get("default", {}) instead of .default for safer client options access
- Store target_platform and target_auth_type as DriverActor attributes
- Remove unused versions import from driver.py

Agent-Logs-Url: https://github.com/elastic/rally/sessions/1c4b9405-a245-4d6e-95f0-8358de160d35

Co-authored-by: gareth-ellis <14981026+gareth-ellis@users.noreply.github.com>

Copilot AI commented Apr 8, 2026

Copy link
Copy Markdown
Contributor Author

As well as this, could you also add the three values (cluster id / cluster name) (you could refer to this as target_id), target_platform and target_auth_type to each document that is indexed? the same...

Done in commit b664cbb. The three values now appear in every indexed document in two ways:

  1. Telemetry metrics documents (latency, throughput, etc.): target_id, target_platform, and target_auth_type are stored via add_meta_info(MetaInfoScope.cluster, ...) in ClusterEnvironmentInfo.on_benchmark_start(), so they appear in the meta.* field of every telemetry document — the same way user tags and source_revision are added.

  2. Race result documents (from Race.to_result_dicts()): target-id, target-platform, and target-auth-type are added as top-level fields alongside distribution-version, distribution-flavor, etc. These are computed in Driver.prepare_benchmark() and propagated through the PreparationComplete message → BenchmarkCoordinator.on_preparation_complete()Race object.

Note: the meta key for the cluster name was renamed from cluster_name to target_id as suggested.

@gareth-ellis

Copy link
Copy Markdown
Member

@copilot theres some lint issues - can you check and fix?

Agent-Logs-Url: https://github.com/elastic/rally/sessions/1a1a49d5-3b57-4cc8-ae10-ff1b263664cb

Co-authored-by: gareth-ellis <14981026+gareth-ellis@users.noreply.github.com>

Copilot AI commented Apr 9, 2026

Copy link
Copy Markdown
Contributor Author

@copilot theres some lint issues - can you check and fix?

Fixed in commit 12ba93a — pylint line-too-long in racecontrol.py and black formatting in telemetry_test.py.

@gareth-ellis gareth-ellis marked this pull request as ready for review April 10, 2026 06:15

@gareth-ellis gareth-ellis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@inqueue inqueue left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@inqueue inqueue merged commit 3c72da3 into master Apr 16, 2026
26 checks passed
@inqueue inqueue deleted the copilot/fetch-store-meta-info branch April 16, 2026 18:15
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.

Fetch and store meta info for target cluster

4 participants