Skip to content

Commit 522414b

Browse files
authored
Merge branch 'main' into herin049
2 parents a4f1b14 + 6ae0f47 commit 522414b

21 files changed

Lines changed: 4861 additions & 3804 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6666
([#4001](https://github.com/open-telemetry/opentelemetry-python-contrib/issues/4001))
6767
- `opentelemetry-instrumentation-psycopg`: Fix `instrument_connection` method to use `_new_cursor_async_factory` on async connections.
6868
([#3956](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3956))
69-
- `opentelemetry-instrumentation-dbapi`: Replace SpanAttributes with semconv constants where applicable
69+
- `opentelemetry-instrumentation-dbapi`: Replace SpanAttributes with semconv constants where applicable
7070
([#4058](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4058))
71-
- `opentelemetry-instrumentation-django`: Replace SpanAttributes with semconv constants where applicable
71+
- `opentelemetry-instrumentation-django`: Replace SpanAttributes with semconv constants where applicable
7272
([#4059](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4059))
73-
- `opentelemetry-instrumentation-botocore`: Replace SpanAttributes with semconv constants where applicable
73+
- `opentelemetry-instrumentation-botocore`: Replace SpanAttributes with semconv constants where applicable
7474
([#4063](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4063))
7575
- `opentelemetry-instrumentation-celery`: Replace SpanAttributes with semconv constants where applicable
7676
([#4056](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4056))
@@ -102,8 +102,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
102102
([#3729](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3729))
103103
- `opentelemetry-instrumentation-confluent-kafka`: Fix incorrect number of argument to `_inner_wrap_close`
104104
([#3922](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3922))
105-
- `opentelemetry-instrumentation-urllib3`: fix multiple arguments error
105+
- `opentelemetry-instrumentation-urllib3`: fix multiple arguments error
106106
([#4144](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4144))
107+
- `opentelemetry-instrumentation-aiohttp-server`: fix HTTP error inconsistencies
108+
([#4175](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4175))
107109

108110
### Breaking changes
109111

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

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

88
## Unreleased
99
- Fix bug in how tokens are counted when using the streaming `generateContent` method. ([#4152](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4152)).
10-
11-
## Version 0.7b0 (2026-02-03)
12-
1310
- Add `gen_ai.tool.definitions` attribute to `gen_ai.client.inference.operation.details` log event ([#4142](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4142)).
1411

1512
## Version 0.6b0 (2026-01-27)

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

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

88
## Unreleased
99

10+
- Added support to call genai utils handler for langchain LLM invocations.
11+
([https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3889](#3889))
12+
1013
- Added span support for genAI langchain llm invocation.
1114
([#3665](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3665))

instrumentation-genai/opentelemetry-instrumentation-langchain/examples/manual/README.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ Next, set up a virtual environment like this:
2626
source .venv/bin/activate
2727
pip install "python-dotenv[cli]"
2828
pip install -r requirements.txt
29+
pip install opentelemetry-instrumentation-langchain
30+
pip install util/opentelemetry-util-genai (once opentelemetry-util-genai package is released remove it from here and add dependency in opentelemetry-instrumentation-langchain)
2931

3032
Run
3133
---

instrumentation-genai/opentelemetry-instrumentation-langchain/pyproject.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ classifiers = [
2525
"Programming Language :: Python :: 3.13",
2626
]
2727
dependencies = [
28-
"opentelemetry-api >= 1.31.0",
2928
"opentelemetry-instrumentation ~= 0.57b0",
30-
"opentelemetry-semantic-conventions ~= 0.57b0"
3129
]
3230

3331
[project.optional-dependencies]

instrumentation-genai/opentelemetry-instrumentation-langchain/src/opentelemetry/instrumentation/langchain/__init__.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,16 @@
3838

3939
from typing import Any, Callable, Collection
4040

41-
from langchain_core.callbacks import BaseCallbackHandler # type: ignore
41+
from langchain_core.callbacks import BaseCallbackHandler
4242
from wrapt import wrap_function_wrapper # type: ignore
4343

4444
from opentelemetry.instrumentation.instrumentor import BaseInstrumentor
4545
from opentelemetry.instrumentation.langchain.callback_handler import (
4646
OpenTelemetryLangChainCallbackHandler,
4747
)
4848
from opentelemetry.instrumentation.langchain.package import _instruments
49-
from opentelemetry.instrumentation.langchain.version import __version__
5049
from opentelemetry.instrumentation.utils import unwrap
51-
from opentelemetry.semconv.schemas import Schemas
52-
from opentelemetry.trace import get_tracer
50+
from opentelemetry.util.genai.handler import get_telemetry_handler
5351

5452

5553
class LangChainInstrumentor(BaseInstrumentor):
@@ -72,15 +70,12 @@ def _instrument(self, **kwargs: Any):
7270
Enable Langchain instrumentation.
7371
"""
7472
tracer_provider = kwargs.get("tracer_provider")
75-
tracer = get_tracer(
76-
__name__,
77-
__version__,
78-
tracer_provider,
79-
schema_url=Schemas.V1_37_0.value,
80-
)
8173

74+
telemetry_handler = get_telemetry_handler(
75+
tracer_provider=tracer_provider
76+
)
8277
otel_callback_handler = OpenTelemetryLangChainCallbackHandler(
83-
tracer=tracer,
78+
telemetry_handler=telemetry_handler
8479
)
8580

8681
wrap_function_wrapper(
@@ -109,7 +104,7 @@ def __init__(
109104
def __call__(
110105
self,
111106
wrapped: Callable[..., None],
112-
instance: BaseCallbackHandler, # type: ignore
107+
instance: BaseCallbackHandler,
113108
args: tuple[Any, ...],
114109
kwargs: dict[str, Any],
115110
):

0 commit comments

Comments
 (0)