Description
Add a new OpenTelemetry auto-instrumentation for Langchain Library. This instrumentation will greatly improve the observability and tracing capabilities of the Langchain based applications.
Details
- Instrumentation Name:
instrumentation-langchain
- Description: This instrumentation will provide automatic tracing and observability for the Langchain Library.
- Language: TypeScript
Motivation
Adding this instrumentation will allow seamless integration of OpenTelemetry with Langchain enabling better visibility into chains which will be represented as workflows/traces in tracing data and Traceloop dashoard.
High Level Instructions
- Add a new package in this monorepo which should called
instrumentation-langchain, with the same structure/boilerplate of instrumentation-openai.
- Implement the auto instrumentation such that (quite similar to the instrumentation logic in the python sdk):
- Every chain in Langchain will produce a span with the name
<chain class name>.task
- Traceloop Span Kind attribute from the
semantic-convetions should be set to task and the span name is <chain class name>.task.
- Propagate also the Workflow Name and Correlation Ids as well.
- Produce workflow span For SequentialChain & RetrievalQA chains.
- Integrate the above implemented instrumentation within
traceloop-sdk
- Add tests
Checklist
Please make sure the following criteria are met:
Thank you!
Description
Add a new OpenTelemetry auto-instrumentation for Langchain Library. This instrumentation will greatly improve the observability and tracing capabilities of the Langchain based applications.
Details
instrumentation-langchainMotivation
Adding this instrumentation will allow seamless integration of OpenTelemetry with Langchain enabling better visibility into chains which will be represented as
workflows/tracesin tracing data and Traceloop dashoard.High Level Instructions
instrumentation-langchain, with the same structure/boilerplate ofinstrumentation-openai.<chain class name>.tasksemantic-convetionsshould be set totaskand the span name is<chain class name>.task.traceloop-sdkChecklist
Please make sure the following criteria are met:
Thank you!