|
12 | 12 | from typing import Tuple |
13 | 13 | from typing import Union |
14 | 14 |
|
15 | | -import six |
16 | | - |
17 | 15 | from ddtrace.constants import USER_ID_KEY |
18 | 16 | from ddtrace.internal import compat |
19 | 17 | from ddtrace.internal.compat import parse |
|
25 | 23 | from ddtrace.internal.http import HTTPConnection |
26 | 24 | from ddtrace.internal.http import HTTPSConnection |
27 | 25 | from ddtrace.internal.uds import UDSHTTPConnection |
| 26 | +from ddtrace.internal.utils import _get_metas_to_propagate |
28 | 27 | from ddtrace.internal.utils.cache import cached |
29 | 28 |
|
30 | 29 |
|
@@ -173,13 +172,8 @@ def w3c_get_dd_list_member(context): |
173 | 172 | tags.append("t.usr.id:{}".format(w3c_encode_tag((_W3C_TRACESTATE_INVALID_CHARS_REGEX_VALUE, "_", usr_id)))) |
174 | 173 |
|
175 | 174 | current_tags_len = sum(len(i) for i in tags) |
176 | | - for k, v in context._meta.items(): |
177 | | - if ( |
178 | | - isinstance(k, six.string_types) |
179 | | - and k.startswith("_dd.p.") |
180 | | - # we've already added sampling decision and user id |
181 | | - and k not in [SAMPLING_DECISION_TRACE_TAG_KEY, USER_ID_KEY] |
182 | | - ): |
| 175 | + for k, v in _get_metas_to_propagate(context): |
| 176 | + if k not in [SAMPLING_DECISION_TRACE_TAG_KEY, USER_ID_KEY]: |
183 | 177 | # for key replace ",", "=", and characters outside the ASCII range 0x20 to 0x7E |
184 | 178 | # for value replace ",", ";", "~" and characters outside the ASCII range 0x20 to 0x7E |
185 | 179 | k = k.replace("_dd.p.", "t.") |
|
0 commit comments