Skip to content

Commit ab81158

Browse files
authored
[core] Use constants for manual.keep and manual.drop (#919)
1 parent ffacf28 commit ab81158

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

ddtrace/constants.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@
55
ORIGIN_KEY = '_dd.origin'
66

77
NUMERIC_TAGS = (ANALYTICS_SAMPLE_RATE_KEY, )
8+
9+
MANUAL_DROP_KEY = 'manual.drop'
10+
MANUAL_KEEP_KEY = 'manual.keep'

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 NUMERIC_TAGS
8+
from .constants import NUMERIC_TAGS, MANUAL_DROP_KEY, MANUAL_KEEP_KEY
99
from .ext import errors, priority
1010
from .internal.logger import get_logger
1111

@@ -138,10 +138,10 @@ def set_tag(self, key, value=None):
138138
log.debug('error setting numeric metric {}:{}'.format(key, value))
139139

140140
return
141-
elif key == 'manual.keep':
141+
elif key == MANUAL_KEEP_KEY:
142142
self.context.sampling_priority = priority.USER_KEEP
143143
return
144-
elif key == 'manual.drop':
144+
elif key == MANUAL_DROP_KEY:
145145
self.context.sampling_priority = priority.USER_REJECT
146146
return
147147

0 commit comments

Comments
 (0)