Configuration
On this page
There is no config file, environment-variable schema, or settings object
in this module — "configuration" means the constructor arguments to the
tracer's exporters, plus the two Tracer methods that turn tracing on
and off. This page collects every configurable option found in the
source, in one place.
Enabling tracing
ConsoleExporter options
See ConsoleExporter for the exact
output format.
JSONExporter options
See JSONExporter for truncation
behavior (spans go through Span.to_dict(), which
truncates input/output beyond 2000 characters).
LangSmithExporter options
See LangSmithExporter for the
full Span → LangSmith Run field mapping.
Per-span options
Passed to Tracer.span(...) or
trace(...):
What is not configurable
Reading the source, these are fixed and cannot currently be changed via any parameter:
- The
_safe_reprtruncation limit used bySpan.to_dict()is hard-coded to 2000 characters. - The worker-thread join timeout in
Tracer.shutdown()is hard-coded to 5 seconds. Tracer.flush(timeout=...)accepts atimeoutargument but does not actually enforce it (see the warning on that page) — there is currently no way to bound how longflush()blocks.
Next: Cookbook for end-to-end configuration recipes.