Skip to content

Commit c6b4a0f

Browse files
authored
Merge branch 'main' into tnorth/fix
2 parents e4915b5 + 40932c2 commit c6b4a0f

File tree

114 files changed

+9020
-3655
lines changed

Some content is hidden

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

114 files changed

+9020
-3655
lines changed

.github/component_owners.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,6 @@ components:
4848
instrumentation-genai/opentelemetry-instrumentation-langchain:
4949
- zhirafovod
5050
- wrisa
51+
52+
instrumentation-genai/opentelemetry-instrumentation-openai-agents-v2:
53+
- nagkumar91

CHANGELOG.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313

1414
### Fixed
1515

16+
- `opentelemetry-instrumentation-botocore`: migrate off the deprecated events API to use the logs API
17+
([#3624](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3624))
1618
- `opentelemetry-instrumentation-dbapi`: fix crash retrieving libpq version when enabling commenter with psycopg
1719
([#3796](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3796))
18-
- `opentelemetry-instrumentation-vertexai`: migrate off the deprecated events API to use the logs API
19-
([#3625](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3626))
20+
- `opentelemetry-instrumentation-fastapi`: Fix handling of APIRoute subclasses
21+
([#3681](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3681))
2022

2123
### Added
22-
- `opentelemetry-instrumentation`: botocore: Add support for AWS Secrets Manager semantic convention attribute
24+
25+
- `opentelemetry-instrumentation-botocore`: Add support for AWS Secrets Manager semantic convention attribute
2326
([#3765](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3765))
27+
- `opentelemetry-instrumentation-dbapi`: Add support for `commenter_options` in `trace_integration` function to control SQLCommenter behavior
28+
([#3743](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3743))
2429
- Add `rstcheck` to pre-commit to stop introducing invalid RST
2530
([#3777](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3777))
26-
- `opentelemetry-exporter-credential-provider-gcp`: create this package which provides support for supplying your machine's Application Default Credentials (https://cloud.google.com/docs/authentication/application-default-credentials) to the OTLP Exporters created automatically by OpenTelemetry Python's auto instrumentation. These credentials authorize OTLP traces to be sent to `telemetry.googleapis.com`.
27-
[#3766](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3766).
31+
- `opentelemetry-exporter-credential-provider-gcp`: create this package which provides support for supplying your machine's Application Default
32+
Credentials (https://cloud.google.com/docs/authentication/application-default-credentials) to the OTLP Exporters created automatically by OpenTelemetry Python's auto instrumentation. These credentials authorize OTLP traces to be sent to `telemetry.googleapis.com`. [#3766](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3766).
33+
- `opentelemetry-instrumentation-psycopg`: Add missing parameter `capture_parameters` to instrumentor.
34+
([#3676](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3676))
35+
- `opentelemetry-instrumentation-dbapi`: Adds sqlcommenter to documentation.
36+
([#3720](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3720))
2837

2938
## Version 1.37.0/0.58b0 (2025-09-11)
3039

docs/conf.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,14 @@ def getlistcfg(strval):
155155
]
156156

157157

158-
ignore_categories = ["py-class", "py-func", "py-exc", "py-obj", "any"]
158+
ignore_categories = [
159+
"py-class",
160+
"py-func",
161+
"py-exc",
162+
"py-obj",
163+
"py-data",
164+
"any",
165+
]
159166

160167
for category in ignore_categories:
161168
if category in mcfg:

docs/nitpick-exceptions.ini

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ py-class=
4545
psycopg.AsyncConnection
4646
ObjectProxy
4747
fastapi.applications.FastAPI
48+
_contextvars.Token
4849

4950
any=
5051
; API
@@ -75,6 +76,10 @@ py-obj=
7576
opentelemetry.instrumentation.dbapi.ConnectionT
7677
opentelemetry.instrumentation.dbapi.CursorT
7778

79+
py-data=
80+
typing.Union
81+
typing.Optional
82+
7883
py-func=
7984
poll
8085
flush

instrumentation-genai/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
| --------------- | ------------------ | --------------- | -------------- |
44
| [opentelemetry-instrumentation-google-genai](./opentelemetry-instrumentation-google-genai) | google-genai >= 1.0.0 | No | development
55
| [opentelemetry-instrumentation-langchain](./opentelemetry-instrumentation-langchain) | langchain >= 0.3.21 | No | development
6+
| [opentelemetry-instrumentation-openai-agents-v2](./opentelemetry-instrumentation-openai-agents-v2) | openai-agents >= 0.3.3 | No | development
67
| [opentelemetry-instrumentation-openai-v2](./opentelemetry-instrumentation-openai-v2) | openai >= 1.26.0 | Yes | development
78
| [opentelemetry-instrumentation-vertexai](./opentelemetry-instrumentation-vertexai) | google-cloud-aiplatform >= 1.64 | No | development
89
| [opentelemetry-instrumentation-weaviate](./opentelemetry-instrumentation-weaviate) | weaviate-client >= 3.0.0,<5.0.0 | No | development

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

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

88
## Unreleased
99

10+
- Implement the new semantic convention changes made in https://github.com/open-telemetry/semantic-conventions/pull/2179.
11+
A single event (`gen_ai.client.inference.operation.details`) is used to capture Chat History. This is opt-in,
12+
an environment variable OTEL_SEMCONV_STABILITY_OPT_IN needs to be set to `gen_ai_latest_experimental` to see them ([#3386](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3386))
13+
- Support CompletionHook for upload to cloud storage.
14+
1015
## Version 0.3b0 (2025-07-08)
1116

1217
- Add automatic instrumentation to tool call functions ([#3446](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3446))

instrumentation-genai/opentelemetry-instrumentation-google-genai/examples/manual/main.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222

2323
import google.genai
2424

25-
# NOTE: OpenTelemetry Python Logs and Events APIs are in beta
26-
from opentelemetry import _events as otel_events
25+
# NOTE: OpenTelemetry Python Logs API is in beta
2726
from opentelemetry import _logs as otel_logs
2827
from opentelemetry import metrics as otel_metrics
2928
from opentelemetry import trace as otel_trace
@@ -40,7 +39,6 @@
4039
GoogleGenAiSdkInstrumentor,
4140
)
4241
from opentelemetry.instrumentation.requests import RequestsInstrumentor
43-
from opentelemetry.sdk._events import EventLoggerProvider
4442
from opentelemetry.sdk._logs import LoggerProvider
4543
from opentelemetry.sdk._logs.export import BatchLogRecordProcessor
4644
from opentelemetry.sdk.metrics import MeterProvider
@@ -56,12 +54,11 @@ def setup_otel_tracing():
5654
)
5755

5856

59-
def setup_otel_logs_and_events():
57+
def setup_otel_logs():
6058
otel_logs.set_logger_provider(LoggerProvider())
6159
otel_logs.get_logger_provider().add_log_record_processor(
6260
BatchLogRecordProcessor(OTLPLogExporter())
6361
)
64-
otel_events.set_event_logger_provider(EventLoggerProvider())
6562

6663

6764
def setup_otel_metrics():
@@ -77,7 +74,7 @@ def setup_otel_metrics():
7774

7875
def setup_opentelemetry():
7976
setup_otel_tracing()
80-
setup_otel_logs_and_events()
77+
setup_otel_logs()
8178
setup_otel_metrics()
8279

8380

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,16 @@ classifiers = [
3737
"Programming Language :: Python :: 3.12"
3838
]
3939
dependencies = [
40-
"opentelemetry-api >=1.31.1, <2",
41-
"opentelemetry-instrumentation >=0.52b1, <2",
42-
"opentelemetry-semantic-conventions >=0.52b1, <2"
43-
]
40+
"opentelemetry-api ~=1.37",
41+
"opentelemetry-instrumentation >=0.58b0, <2",
42+
"opentelemetry-semantic-conventions >=0.58b0, <2",
43+
# TODO https://github.com/open-telemetry/opentelemetry-python-contrib/issues/3786: restrict
44+
# version after the first release
45+
"opentelemetry-util-genai",]
4446

4547
[project.optional-dependencies]
4648
instruments = [
47-
"google-genai >= 1.0.0"
49+
"google-genai >= 1.32.0"
4850
]
4951

5052
[project.entry-points.opentelemetry_instrumentor]

instrumentation-genai/opentelemetry-instrumentation-google-genai/src/opentelemetry/instrumentation/google_genai/flags.py

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,25 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
import os
15+
from os import environ
16+
from typing import Union
1617

17-
_CONTENT_RECORDING_ENV_VAR = (
18-
"OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT"
18+
from opentelemetry.instrumentation._semconv import _StabilityMode
19+
from opentelemetry.util.genai.environment_variables import (
20+
OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT,
1921
)
22+
from opentelemetry.util.genai.types import ContentCapturingMode
23+
from opentelemetry.util.genai.utils import get_content_capturing_mode
2024

2125

22-
def is_content_recording_enabled():
23-
return os.getenv(_CONTENT_RECORDING_ENV_VAR, "false").lower() == "true"
26+
def is_content_recording_enabled(
27+
mode: _StabilityMode,
28+
) -> Union[bool, ContentCapturingMode]:
29+
if mode == _StabilityMode.DEFAULT:
30+
capture_content = environ.get(
31+
OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT, "false"
32+
)
33+
return capture_content.lower() == "true"
34+
if mode == _StabilityMode.GEN_AI_LATEST_EXPERIMENTAL:
35+
return get_content_capturing_mode()
36+
raise RuntimeError(f"{mode} mode not supported")

0 commit comments

Comments
 (0)