Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions genai-perf/genai_perf/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from enum import Enum, auto
from pathlib import Path
from typing import List, Optional, Tuple

import re
import genai_perf.logging as logging
import genai_perf.utils as utils
from genai_perf.config.endpoint_config import endpoint_type_map
Expand Down Expand Up @@ -862,7 +862,9 @@ def init_parsers():
def get_passthrough_args_index(argv: list) -> int:
if "--" in argv:
passthrough_index = argv.index("--")
logger.info(f"Detected passthrough args: {argv[passthrough_index + 1:]}")
passthrough_cmd = ' '.join(argv[passthrough_index + 1:])
masked_cmd = re.sub(r'(-H Authorization: Bearer )\S+', r'\1********', passthrough_cmd)
logger.info(f"Detected passthrough args: {masked_cmd.split()}")
else:
passthrough_index = len(argv)

Expand Down
6 changes: 5 additions & 1 deletion genai-perf/genai_perf/subcommand/subcommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import os
import subprocess # nosec
import re
from typing import Dict, List, Optional, Tuple

import genai_perf.logging as logging
Expand Down Expand Up @@ -95,7 +96,10 @@ def _run_perf_analyzer(

remove_file(perf_analyzer_config.get_profile_export_file())
cmd = perf_analyzer_config.create_command()
logger.info(f"Running Perf Analyzer : '{' '.join(cmd)}'")

# Mask the Authorization token
masked_cmd = re.sub(r'(-H Authorization: Bearer )\S+', r'\1********', ' '.join(cmd))
logger.info(f"Running Perf Analyzer : '{masked_cmd}'")

if self._config.verbose or self._config.perf_analyzer.verbose:
subprocess.run(cmd, check=True, stdout=None) # nosec
Expand Down
Loading