Skip to content

Commit e0aa466

Browse files
authored
Merge branch 'main' into tnorth/fix
2 parents 7cbc5f7 + 60a670f commit e0aa466

File tree

60 files changed

+6135
-2862
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+6135
-2862
lines changed

.github/component_owners.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,7 @@ components:
4040
util/opentelemetry-util-genai:
4141
- DylanRussell
4242
- keith-decker
43+
44+
instrumentation-genai/opentelemetry-instrumentation-langchain:
45+
- zhirafovod
46+
- wrisa

CHANGELOG.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4040

4141
### Added
4242

43-
- `opentelemetry-util-genai` Add a utility to parse the `OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT` environment variable.
44-
Add `gen_ai_latest_experimental` as a new value to the Sem Conv stability flag ([#3716](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3716)).
4543
- `opentelemetry-instrumentation-confluent-kafka` Add support for confluent-kafka <=2.11.0
4644
([#3685](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3685))
4745
- `opentelemetry-instrumentation-system-metrics`: Add `cpython.gc.collected_objects` and `cpython.gc.uncollectable_objects` metrics

dev-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
pylint==3.0.2
22
httpretty==1.1.4
3-
pyright==v1.1.396
3+
pyright==v1.1.404
44
sphinx==7.1.2
55
sphinx-rtd-theme==2.0.0rc4
66
sphinx-autodoc-typehints==1.25.2

docs-requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ pymemcache~=1.3
99
# Required by conf
1010
django>=2.2
1111

12+
# Require by opentelemetry-util-genai
13+
fsspec>=2025.9.0
14+
1215
# Required by instrumentation and exporter packages
1316
aio_pika~=7.2.0
1417
aiohttp~=3.0

docs/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@
130130
None,
131131
),
132132
"redis": ("https://redis.readthedocs.io/en/latest/", None),
133+
"fsspec": ("https://filesystem-spec.readthedocs.io/en/latest/", None),
133134
}
134135

135136
# http://www.sphinx-doc.org/en/master/config.html#confval-nitpicky

docs/instrumentation-genai/util.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,7 @@ OpenTelemetry Python - GenAI Util
2525
:members:
2626
:undoc-members:
2727
:show-inheritance:
28+
29+
.. automodule:: opentelemetry.util.genai._fsspec_upload
30+
:members:
31+
:show-inheritance:

instrumentation-genai/opentelemetry-instrumentation-langchain/CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## Unreleased
8+
## Unreleased
9+
10+
- Added span support for genAI langchain llm invocation.
11+
([#3665](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3665))
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
This project is inspired by and portions of it are derived from Traceloop OpenLLMetry
2+
(https://github.com/traceloop/openllmetry).
3+
Licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0).
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Update this with your real OpenAI API key
2+
OPENAI_API_KEY=sk-YOUR_API_KEY
3+
4+
# Uncomment and change to your OTLP endpoint
5+
# OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
6+
# OTEL_EXPORTER_OTLP_PROTOCOL=grpc
7+
8+
OTEL_SERVICE_NAME=opentelemetry-python-langchain-manual
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
OpenTelemetry Langcahin Instrumentation Example
2+
============================================
3+
4+
This is an example of how to instrument Langchain when configuring OpenTelemetry SDK and instrumentations manually.
5+
6+
When :code:`main.py <main.py>`_ is run, it exports traces to an OTLP-compatible endpoint.
7+
Traces include details such as the span name and other attributes.
8+
9+
Note: :code:`.env <.env>`_ file configures additional environment variables:
10+
- :code:`OTEL_LOGS_EXPORTER=otlp` to specify exporter type.
11+
- :code:`OPENAI_API_KEY` open AI key for accessing the OpenAI API.
12+
- :code:`OTEL_EXPORTER_OTLP_ENDPOINT` to specify the endpoint for exporting traces (default is http://localhost:4317).
13+
14+
Setup
15+
-----
16+
17+
Minimally, update the :code:`.env <.env>`_ file with your :code:`OPENAI_API_KEY`.
18+
An OTLP compatible endpoint should be listening for traces http://localhost:4317.
19+
If not, update :code:`OTEL_EXPORTER_OTLP_ENDPOINT` as well.
20+
21+
Next, set up a virtual environment like this:
22+
23+
::
24+
25+
python3 -m venv .venv
26+
source .venv/bin/activate
27+
pip install "python-dotenv[cli]"
28+
pip install -r requirements.txt
29+
30+
Run
31+
---
32+
33+
Run the example like this:
34+
35+
::
36+
37+
dotenv run -- python main.py
38+
39+
You should see the capital of France generated by Langchain ChatOpenAI while traces export to your configured observability tool.

0 commit comments

Comments
 (0)