Skip to content

Commit 30b06fb

Browse files
authored
Skip masking for Kinesis PartitionKey (#179)
1 parent a0050e7 commit 30b06fb

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/lumigo_tracer/wrappers/http/http_parser.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,10 @@ def _extract_message_id(response_body: bytes) -> Optional[str]:
217217
safe_key_from_json(response_body, "Records", []), [0, "SequenceNumber"] # type: ignore
218218
)
219219

220+
@staticmethod
221+
def get_omit_skip_path() -> Optional[List[str]]:
222+
return ["PartitionKey"]
223+
220224

221225
class SqsParser(ServerlessAWSParser):
222226
def parse_request(self, parse_params: HttpRequest) -> dict:

src/test/component/test_component.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ def lambda_test_function():
144144
assert events[0]["info"]["httpInfo"]["host"] == f"kinesis.{region}.amazonaws.com"
145145
assert events[0]["info"]["resourceName"] == kinesis_resource
146146
assert events[0]["info"]["messageId"]
147+
# No scrubbing for PartitionKey
148+
assert json.loads(events[0]["info"]["httpInfo"]["request"]["body"])["PartitionKey"] == "1"
147149
# Batch messages.
148150
assert events[1]["info"]["httpInfo"]["host"] == f"kinesis.{region}.amazonaws.com"
149151
assert events[1]["info"]["resourceName"] == kinesis_resource

0 commit comments

Comments
 (0)