Skip to content

Instrumentation API

agentlightning.instrumentation.instrument_all()

Instrument all the instrumentation libraries.

agentlightning.instrumentation.uninstrument_all()

Uninstrument all the instrumentation libraries.

AgentOps LangChain

agentlightning.instrumentation.agentops_langchain

instrument_agentops_langchain()

Bypass AgentOp's native support for Langchain.

uninstrument_agentops_langchain()

Restore AgentOp's native support for Langchain.

AgentOps

agentlightning.instrumentation.agentops

BypassableAuthenticatedOTLPExporter

Bases: AuthenticatedOTLPExporter

AuthenticatedOTLPExporter with switchable service control. When _agentops_service_enabled is False, skip export and return success.

BypassableOTLPMetricExporter

Bases: OTLPMetricExporter

OTLPMetricExporter with switchable service control. When _agentops_service_enabled is False, skip export and return success.

BypassableOTLPSpanExporter

Bases: OTLPSpanExporter

OTLPSpanExporter with switchable service control. When _agentops_service_enabled is False, skip export and return success.

BypassableV3Client

Bases: V3Client

V3Client with toggleable authentication calls. Returns dummy auth response when _agentops_service_enabled is False.

BypassableV4Client

Bases: V4Client

V4Client with toggleable post requests. Returns dummy response when _agentops_service_enabled is False.

enable_agentops_service(enabled=True)

Enable or disable communication with the AgentOps service.

False (default): AgentOps exporters and clients will run in local mode and will not attempt to communicate with the remote AgentOps service. True: all exporters and clients will operate in normal mode and send data to the AgentOps service as expected.

instrument_agentops()

Instrument agentops to capture token IDs. Automatically detects and uses the appropriate patching method based on the installed agentops version.

uninstrument_agentops()

Uninstrument agentops to stop capturing token IDs.

LiteLLM

agentlightning.instrumentation.litellm

LiteLLM instrumentations.

It's unclear whether or not this file is useful. It seems that LiteLLM owns its own telemetry from their own entrance

Related documentation.

instrument_litellm()

Instrument litellm to capture token IDs.

uninstrument_litellm()

Uninstrument litellm to stop capturing token IDs.

vLLM

agentlightning.instrumentation.vllm

instrument_vllm()

Instrument vLLM to capture token IDs generated by engine.

This instrumentation has been merged to upstream vLLM since v0.10.2.

uninstrument_vllm()

Uninstrument vLLM to stop capturing token IDs generated by engine.