LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • Client
  • AsyncClient
  • Run Helpers
  • Run Trees
  • Evaluation
  • Schemas
  • Utilities
  • Wrappers
  • Anonymizer
  • Testing
  • Expect API
  • Middleware
  • Pytest Plugin
  • Deployment SDK
  • RemoteGraph
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

OverviewClientAsyncClientRun HelpersRun TreesEvaluationSchemasUtilitiesWrappersAnonymizerTestingExpect APIMiddlewarePytest PluginDeployment SDKRemoteGraph
Language
Theme
PythonlangsmithmiddlewareTracingMiddleware
Class●Since v0.1

TracingMiddleware

Middleware for propagating distributed tracing context using LangSmith.

This middleware checks for the 'langsmith-trace' header and propagates the tracing context if present. It does not start new traces by default.

Designed to work with ASGI applications.

Copy
TracingMiddleware(
    self,
    app,
)

Used in Docs

  • Implement distributed tracing

Constructors

constructor
__init__
NameType
appunknown

Attributes

attribute
app: app
View source on GitHub