Skip to main content

OpenTelemetry instrumentation for LangChain and LangGraph spans and metrics.

Project description

langchain-instrumentation

OpenTelemetry instrumentation SDK for LangChain and LangGraph.

Install

pip install langchain-instrumentation

Quickstart

from langchain_instrumentation import LangChainConfig, LangChainInstrumentor

instrumentor = LangChainInstrumentor(LangChainConfig())
instrumentor.instrument()

# Optional manual handler injection in custom callback manager flows
handler = instrumentor.handler

# Shutdown or test cleanup
instrumentor.uninstrument()

What it instruments

  • LangChain callback lifecycle spans
  • Optional LangGraph tracing hooks
  • Optional agent factory tracing hooks
  • Metrics and structured log emission

Configuration

LangChainConfig controls behavior. Most-used flags:

  • emit_metrics, emit_logs
  • patch_callback_manager, patch_langgraph, patch_langchain_factories
  • record_content, record_raw_payloads, redact_keys

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langchain_instrumentation-0.1.0.tar.gz (27.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

langchain_instrumentation-0.1.0-py3-none-any.whl (32.4 kB view details)

Uploaded Python 3

File details

Details for the file langchain_instrumentation-0.1.0.tar.gz.

File metadata

File hashes

Hashes for langchain_instrumentation-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b7d53ff8b4293f212933fe7d20d83d0a3f8921cd4cb2ec19dd577a72b6c65e26
MD5 494c702b781537238aaa15eb672b1848
BLAKE2b-256 b08e2019993a88d566a0d8f89dfad4e0b7027db32941578d84767f64cf4abfd4

See more details on using hashes here.

Provenance

The following attestation bundles were made for langchain_instrumentation-0.1.0.tar.gz:

Publisher: publish.yml on Onlykh/langchain-instrumentation

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file langchain_instrumentation-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_instrumentation-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 320603d15b134956bd0d5403f1a3cd39cdc35f51234525f980e5059b93e59b85
MD5 42f6756dc3a308d53ea3476c3ffda289
BLAKE2b-256 d5273a4ee31215bb6a19bb709c578bdef13b9c5460eaa75d94fee539ffbbd956

See more details on using hashes here.

Provenance

The following attestation bundles were made for langchain_instrumentation-0.1.0-py3-none-any.whl:

Publisher: publish.yml on Onlykh/langchain-instrumentation

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page