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
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jobs:
run: sudo yarn global add serverless@^2.72.2 --prefix /usr/local
- name: Install Crossbuild Deps
run: |
sudo apt-get update
sudo apt-get update --allow-releaseinfo-change --fix-missing
sudo apt install -y qemu-user-static binfmt-support

- name: Install dependencies
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/check-size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ jobs:
python-version: 3.7

- name: Install Crossbuild Deps
run: sudo apt install -y qemu-user-static binfmt-support
run: |
sudo apt-get update --allow-releaseinfo-change --fix-missing
sudo apt install -y qemu-user-static binfmt-support
- name: Install dependencies
run: |
Expand Down
3 changes: 2 additions & 1 deletion datadog_lambda/tag_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2021 Datadog, Inc.

from decimal import Decimal
import json
import logging

Expand All @@ -26,7 +27,7 @@ def tag_object(span, key, obj, depth=0):
except ValueError:
redacted = _redact_val(key, obj[0:5000])
return span.set_tag(key, redacted)
if isinstance(obj, int) or isinstance(obj, float):
if isinstance(obj, int) or isinstance(obj, float) or isinstance(obj, Decimal):
return span.set_tag(key, obj)
if isinstance(obj, list):
for k, v in enumerate(obj):
Expand Down
12 changes: 12 additions & 0 deletions tests/test_tag_object.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import unittest
from decimal import Decimal

try:
from unittest.mock import MagicMock, patch, call
Expand Down Expand Up @@ -82,3 +83,14 @@ def test_unicode_tag_object(self):
],
True,
)

def test_decimal_tag_object(self):
payload = {"myValue": Decimal(500.50)}
spanMock = MagicMock()
tag_object(spanMock, "function.request", payload)
spanMock.set_tag.assert_has_calls(
[
call("function.request.myValue", Decimal(500.50)),
],
True,
)