Skip to content

Commit 125c56f

Browse files
authored
Merge branch 'main' into jacksonweber/populate-synthetic-attributes
2 parents 8b113cc + f3d0394 commit 125c56f

File tree

67 files changed

+2422
-921
lines changed

Some content is hidden

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

67 files changed

+2422
-921
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

instrumentation-genai/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +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](./opentelemetry-instrumentation-openai-agents) | openai-agents >= 0.3.3 | No | development
6+
| [opentelemetry-instrumentation-openai-agents-v2](./opentelemetry-instrumentation-openai-agents-v2) | openai-agents >= 0.3.3 | No | development
77
| [opentelemetry-instrumentation-openai-v2](./opentelemetry-instrumentation-openai-v2) | openai >= 1.26.0 | Yes | development
88
| [opentelemetry-instrumentation-vertexai](./opentelemetry-instrumentation-vertexai) | google-cloud-aiplatform >= 1.64 | No | development
99
| [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/pyproject.toml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,15 @@ classifiers = [
3838
]
3939
dependencies = [
4040
"opentelemetry-api ~=1.37",
41-
"opentelemetry-instrumentation >=0.52b1, <2",
42-
"opentelemetry-semantic-conventions >=0.52b1, <2"
43-
]
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)