Skip to content

Commit

Permalink
redact api key
Browse files Browse the repository at this point in the history
  • Loading branch information
erikayasuda committed May 2, 2024
1 parent 0c762d9 commit 8ed887f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ddtrace/internal/flare/flare.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ def _generate_config_file(self, config: dict, pid: int):
config_file = self.flare_dir / f"tracer_config_{pid}.json"
try:
with open(config_file, "w") as f:
# Redact API key if present
api_key = config.get("_dd_api_key")
if api_key:
config["_dd_api_key"] = "*" * (len(api_key) - 4) + api_key[-4:]

tracer_configs = {
"configs": config,
}
Expand Down

0 comments on commit 8ed887f

Please sign in to comment.