Skip to content

Commit

Permalink
Update python.md (#10806)
Browse files Browse the repository at this point in the history
Match how https://github.com/DataDog/dd-trace-py casts trace_id & spand_id as strings

This also protects again issues where a forwarding library may have trouble with large integers (as is happening with the datadog fluent bit forwarding plugin - which is currently rounding down any integers > the largest signed integer to 9223372036854775807)
  • Loading branch information
someboredkiddo committed Jun 11, 2021
1 parent 93c1e6b commit 67baf11
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions content/en/tracing/connect_logs_and_traces/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ def tracer_injection(logger, log_method, event_dict):
trace_id, span_id = get_correlation_ids()

# add ids to structlog event dictionary
event_dict['dd.trace_id'] = trace_id or 0
event_dict['dd.span_id'] = span_id or 0
event_dict['dd.trace_id'] = str(trace_id or 0)
event_dict['dd.span_id'] = str(span_id or 0)

# add the env, service, and version configured for the tracer
event_dict['dd.env'] = ddtrace.config.env or ""
Expand Down

0 comments on commit 67baf11

Please sign in to comment.