Configuring LangSmith observability dashboards > Overview of tracing options > Trace LangGraph application using OpenTelemetry
  

Trace LangGraph application using OpenTelemetry

Tracing LangGraph using OpenTelemetry (OTel) allows you to send telemetry data directly to the LangSmith platform. This compatibility standardizes the tracing of your LLM-powered applications, regardless of whether you are using LangChain or another framework.
To enable OTel and set the OTel exporter as the LangSmith endpoint, you must first install the langsmith[otel] library and then configure the environment variables.
    1Navigate to the external-libs path that is configure in your system. The following is the default path:
    <Secure Agent installation directory>/apps/AIAgentRuntime/data/external-libs
    2Run the following command:
    pip3.13 install "langsmith[otel]" --target <Secure Agent installation directory>/apps/AIAgentRuntime/data/external-libs
    For example:
    pip3.13 install "langsmith[otel]" --target /root/rel_infaagent/apps/AIAgentRuntime/data/external-libs
    Note: Be sure to include the "--target" option. If you omit the target, the libraries are installed into a subdirectory of the latest AIAgentRuntime path and will be ignored when the package is updated.
    3Navigate to the latest AIAgentRuntime package path:
    <Secure Agent installation directory>/downloads/package-AIAgentRuntime.<latest version>/package
    4Locate startup.sh and add the following environment variables:
    export OTEL_EXPORTER_OTLP_ENDPOINT=https://api.smith.langchain.com/otel
    export OTEL_EXPORTER_OTLP_HEADERS="x-api-key=<your api key>"
    export LANGSMITH_OTEL_ENABLED=true
    export LANGSMITH_TRACING=true
    Tip: You can add these variables anywhere in the script.
    5Restart the Secure Agent.
It is helpful to learn how to identify whether a trace was sent by OTel or by LangSmith only.