File tree Expand file tree Collapse file tree
src/swiss_ai_model_launch/loadtest Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -72,6 +72,8 @@ def build_cluster_loadtest_script(
7272 'RUN_CONFIG_JSON="$(cat /work/run_config.json)"' ,
7373 "--env" ,
7474 f"PROMPTS_FILE={ shlex .quote (prompts_path )} " ,
75+ "--env" ,
76+ f"RUN_LABEL={ shlex .quote (run_label )} " ,
7577 "--summary-export" ,
7678 "/work/summary.json" ,
7779 "/work/script.js" ,
Original file line number Diff line number Diff line change @@ -92,6 +92,13 @@ const CFG_PROMPT_LABELS =
9292const BASE_URL = RUN_CFG . server_url ?? DEFAULT_BASE_URL ;
9393const API_KEY = RUN_CFG . api_key ?? "" ;
9494const MODEL = RUN_CFG . model ?? "" ;
95+ // k6 strips non-allowlisted global --tag values from HTTP samples in the
96+ // prometheus exporter, so we re-attach model/run_label per-request below.
97+ const RUN_LABEL = __ENV . RUN_LABEL ?? RUN_CFG . run_label ?? "" ;
98+ const REQUEST_TAGS = {
99+ ...( MODEL ? { model : MODEL } : { } ) ,
100+ ...( RUN_LABEL ? { run_label : RUN_LABEL } : { } ) ,
101+ } ;
95102const REQUEST_TIMEOUT =
96103 RUN_CFG . request_timeout ??
97104 RUN_CFG . scenario_definition ?. request_timeout ??
@@ -388,7 +395,7 @@ function runNonStreaming(prompt) {
388395 const res = http . post ( `${ BASE_URL } ${ ENDPOINT } ` , payload ( prompt ) , {
389396 headers : HEADERS ,
390397 timeout : REQUEST_TIMEOUT ,
391- tags : { [ LABEL_TAG ] : prompt . label , stream : "false" } ,
398+ tags : { ... REQUEST_TAGS , [ LABEL_TAG ] : prompt . label , stream : "false" } ,
392399 } ) ;
393400
394401 activeRequests . add ( - 1 ) ;
You can’t perform that action at this time.
0 commit comments