Fetch and store target cluster meta info at benchmark start#2095
Conversation
- 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>
gareth-ellis
left a comment
There was a problem hiding this comment.
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.
…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>
Done in commit b664cbb. The three values now appear in every indexed document in two ways:
Note: the meta key for the cluster name was renamed from |
|
@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>
Rally contacts the target cluster at benchmark start but discards useful identifying metadata. This adds
target_id,target_platform, andtarget_auth_typeto every indexed document, making it easier to correlate race results with their target clusters without manual tagging.Changes
esrally/telemetry.py—ClusterEnvironmentInfoclient_optionsparameter to__init__on_benchmark_start, extracts and stores three new meta fields viaadd_meta_info(MetaInfoScope.cluster, ...)— the same mechanism as user tags — so they appear in themeta.*field of every telemetry document:target_id— project ID (serverless), cluster ID (ECH), or configured cluster name (on-prem)target_platform—"serverless"(viabuild_flavor),"hosted"(viax-found-handling-clusterresponse header from ECH), or"on-prem"(default)target_auth_type—"api_key"or"basic"derived from client options; omitted if neither is configuredesrally/driver/driver.pyprepare_telemetry()retrieves the default cluster's raw client options from config and passes them toClusterEnvironmentInfoDriver.prepare_benchmark()computestarget_platform(including hosted detection via response headers) andtarget_auth_typewhile the API response is fresh, storing them onDriverActorPreparationCompletemessage extended withtarget_id,target_platform, andtarget_auth_typeesrally/racecontrol.pyon_preparation_complete()receives and setstarget_id,target_platform, andtarget_auth_typeon theRaceobjectesrally/metrics.py—Racetarget_id,target_platform, andtarget_auth_typefieldsto_result_dicts()includestarget-id,target-platform, andtarget-auth-typeas top-level fields alongsidedistribution-versionanddistribution-flavorin race result documentstests/telemetry_test.pytarget_platformcalltarget_idstorage, ECH header detection, api_key/basic auth type detection, and the no-auth case