Skip to content
Open
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
4 changes: 2 additions & 2 deletions ddtrace/contrib/internal/dogpile_cache/lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def wrapped_backend_fetcher():
# should be). This means ANDing all hit values and ORing all expired values.
span = tracer.current_span()
if span:
span.set_tag("hit", asbool(span.get_tag("hit") or "True") and hit)
span.set_tag("expired", asbool(span.get_tag("expired") or "False") or expired)
span.set_tag("hit", str(asbool(span.get_tag("hit") or "True") and hit))
span.set_tag("expired", str(asbool(span.get_tag("expired") or "False") or expired))

instance.value_and_created_fn = wrapped_backend_fetcher
2 changes: 1 addition & 1 deletion ddtrace/contrib/internal/langchain/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def shared_stream(
options.update(extra_options)

span = integration.trace(**options)
span.set_tag("langchain.request.stream", True)
span.set_tag("langchain.request.stream", "True")
on_span_started(span)

try:
Expand Down
5 changes: 4 additions & 1 deletion ddtrace/contrib/internal/trace_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,10 @@ def set_flattened_tags(
) -> None:
for prefix, value in items:
for tag, v in _flatten(value, sep, prefix, exclude_policy):
span.set_tag(tag, processor(v) if processor is not None else v)
v = processor(v) if processor is not None else v
if isinstance(v, bool):
v = str(v)
span.set_tag(tag, v)


def extract_netloc_and_query_info_from_url(url: str) -> tuple[str, str]:
Expand Down
5 changes: 4 additions & 1 deletion ddtrace/internal/opentelemetry/span.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ def _ddmap(span, attribute, value):

if isinstance(value, (str, bytes)):
span.set_tag(meta_key, ensure_text(value))
if isinstance(value, (int, float)):
# DEV: Check bool before int/float since bool subclasses from int
elif isinstance(value, bool):
span.set_tag(meta_key, str(value))
elif isinstance(value, (int, float)):
span._set_attribute(meta_key, value)
else:
setattr(span, attribute, value)
Expand Down
Loading