Skip to content

Commit 280c7a8

Browse files
committed
Bring back NUMERIC_TAGS
1 parent 15f1ac9 commit 280c7a8

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

ddtrace/constants.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33
SAMPLING_PRIORITY_KEY = '_sampling_priority_v1'
44
ANALYTICS_SAMPLE_RATE_KEY = '_dd1.sr.eausr'
55
ORIGIN_KEY = '_dd.origin'
6+
7+
NUMERIC_TAGS = (ANALYTICS_SAMPLE_RATE_KEY, )

ddtrace/span.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import traceback
66

77
from .compat import StringIO, stringify, iteritems, numeric_types
8-
from .constants import ANALYTICS_SAMPLE_RATE_KEY
8+
from .constants import NUMERIC_TAGS
99
from .ext import errors
1010
from .internal.logger import get_logger
1111

@@ -131,11 +131,11 @@ def set_tag(self, key, value):
131131
be ignored.
132132
"""
133133

134-
if key is ANALYTICS_SAMPLE_RATE_KEY:
134+
if key in NUMERIC_TAGS:
135135
try:
136136
self.set_metric(key, float(value))
137137
except (TypeError, ValueError):
138-
log.debug('error setting numeric metric {}:{}'.format(key, value))
138+
log.debug("error setting numeric metric {}:{}".format(key, value))
139139

140140
return
141141
try:

0 commit comments

Comments
 (0)