Skip to content
Merged
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 src/lumigo_tracer/lumigo_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
import inspect
import traceback

LUMIGO_DOMAINS_SCRUBBER_KEY = "LUMIGO_DOMAINS_SCRUBBER"

try:
import botocore
import boto3
Expand Down Expand Up @@ -182,9 +184,9 @@ def config(
Configuration.send_only_if_error = os.environ.get("SEND_ONLY_IF_ERROR", "").lower() == "true"
if domains_scrubber:
domains_scrubber_regex = domains_scrubber
elif "LUMIGO_DOMAINS_SCRUBBER" in os.environ:
elif LUMIGO_DOMAINS_SCRUBBER_KEY in os.environ:
try:
domains_scrubber_regex = json.loads(os.environ["LUMIGO_DOMAIN_SCRUBBER"])
domains_scrubber_regex = json.loads(os.environ[LUMIGO_DOMAINS_SCRUBBER_KEY])
except Exception:
get_logger().critical(
"Could not parse the specified domains scrubber, shutting down the reporter."
Expand Down
6 changes: 6 additions & 0 deletions src/test/unit/test_lumigo_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,12 @@ def test_config_enhanced_printstep_function_without_envs(monkeypatch, configurat
assert Configuration.is_step_function == configuration_value


def test_config_lumigo_domains_scrubber_with_envs(monkeypatch):
monkeypatch.setenv("LUMIGO_DOMAINS_SCRUBBER", '["lambda.us-west-2.amazonaws.com"]')
config()
assert len(Configuration.domains_scrubber) == 1


def test_config_timeout_timer_buffer_with_exception(monkeypatch):
monkeypatch.setenv("LUMIGO_TIMEOUT_BUFFER", "not float")
config()
Expand Down