Fix parsing of binary datadog headers in SQS#7324
Conversation
dougqh
left a comment
There was a problem hiding this comment.
I'm assuming this change is fine.
But I'm wondering why did we assume that the headers were base64 encoded in the first place?
IIRC the code example originally shared with us did base64 decoding for the binary payload. The odd thing is that I can still see base64 decoding used in various places when handling https://github.com/DataDog/datadog-lambda-python/blob/main/datadog_lambda/tracing.py#L263 Hopefully we don't have a situation where some tracers are sending the JSON string base64 encoded and others aren't - because then we may have to peek at the string to see if we need to base64 decode it. Since the practical results in AIDM-205 show base64 decoding is not required we should remove it - but we should keep an eye open for any cases where the opposite is true |
|
@vandonr @dougqh Can you set up the PR labels (like bug and the related instrumentation/component)? It will help @nayeem-kamal with the next release 😉 |
I'm not too sure about Base64 is meant to carry bytes in a String format (in a less efficient way). If we already have a bytes, it really makes no sense to use base64.
yeah... thankfully, json strings start with a
:nod: |
Since it's pretty simple, and can help prevent potential uncomfortable escalations with clients, I added that mechanism to support both while we figure out if we actually need it. |
What Does This Do
The binary data we receive when the data type is marked as binary is not base64, it's the string itself, so we don't need to decode it.
Additional Notes
Jira ticket: AIDM-205