Skip to content

feat(google_genai): apm and llmobs submissions for embed_content google-genai #13880

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 29 commits into from
Jul 9, 2025

Conversation

maxzhangdd
Copy link
Contributor

@maxzhangdd maxzhangdd commented Jul 3, 2025

MLOB-3048

This PR adds support for APM submissions as well as LLMObs submissions for calls to embed_content (sync and async versions) in Google's GenAI Python SDK.

Checklist

  • PR author has checked that all the criteria below are met
  • The PR description includes an overview of the change
  • The PR description articulates the motivation for the change
  • The change includes tests OR the PR description describes a testing strategy
  • The PR description notes risks associated with the change, if any
  • Newly-added code is easy to change
  • The change follows the library release note guidelines
  • The change includes or references documentation updates if necessary
  • Backport labels are set (if applicable)

Reviewer Checklist

  • Reviewer has checked that all the criteria below are met
  • Title is accurate
  • All changes are related to the pull request's stated goal
  • Avoids breaking API changes
  • Testing strategy adequately addresses listed risks
  • Newly-added code is easy to change
  • Release note makes sense to a user of the library
  • If necessary, author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment
  • Backport labels are set in a manner that is consistent with the release branch maintenance policy

Copy link
Contributor

github-actions bot commented Jul 3, 2025

CODEOWNERS have been resolved as:

releasenotes/notes/google_genai_embed_content_submissions-5824ec6d6ce45895.yaml  @DataDog/apm-python
tests/snapshots/tests.contrib.google_genai.test_google_genai.test_google_genai_embed_content.json  @DataDog/apm-python
tests/snapshots/tests.contrib.google_genai.test_google_genai.test_google_genai_embed_content_error.json  @DataDog/apm-python
ddtrace/contrib/internal/google_genai/_utils.py                         @DataDog/ml-observability
ddtrace/contrib/internal/google_genai/patch.py                          @DataDog/ml-observability
ddtrace/llmobs/_constants.py                                            @DataDog/ml-observability
ddtrace/llmobs/_integrations/google_genai.py                            @DataDog/ml-observability
ddtrace/llmobs/_integrations/google_genai_utils.py                      @DataDog/ml-observability
tests/contrib/google_genai/conftest.py                                  @DataDog/ml-observability
tests/contrib/google_genai/test_google_genai.py                         @DataDog/ml-observability
tests/contrib/google_genai/test_google_genai_llmobs.py                  @DataDog/ml-observability
tests/contrib/google_genai/test_google_genai_patch.py                   @DataDog/ml-observability
tests/contrib/google_genai/utils.py                                     @DataDog/ml-observability

Copy link
Contributor

github-actions bot commented Jul 3, 2025

Bootstrap import analysis

Comparison of import times between this PR and base.

Summary

The average import time from this PR is: 289 ± 4 ms.

The average import time from base is: 291 ± 4 ms.

The import time difference between this PR and base is: -2.0 ± 0.2 ms.

Import time breakdown

The following import paths have shrunk:

ddtrace.auto 1.990 ms (0.69%)
ddtrace.bootstrap.sitecustomize 1.306 ms (0.45%)
ddtrace.bootstrap.preload 1.306 ms (0.45%)
ddtrace.internal.remoteconfig.client 0.651 ms (0.23%)
ddtrace 0.683 ms (0.24%)
ddtrace.internal._unpatched 0.035 ms (0.01%)
json 0.035 ms (0.01%)
json.decoder 0.035 ms (0.01%)
re 0.035 ms (0.01%)
enum 0.035 ms (0.01%)
types 0.035 ms (0.01%)

@pr-commenter
Copy link

pr-commenter bot commented Jul 3, 2025

Benchmarks

Benchmark execution time: 2025-07-09 20:55:02

Comparing candidate commit cfa80de in PR branch maxzhang/google-genai-embedcontent with baseline commit 321f9b2 in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 548 metrics, 2 unstable metrics.

@maxzhangdd maxzhangdd marked this pull request as ready for review July 8, 2025 17:22
@maxzhangdd maxzhangdd requested review from a team as code owners July 8, 2025 17:22
@maxzhangdd maxzhangdd requested review from avara1986 and lievan July 8, 2025 17:22
Copy link
Member

@brettlangdon brettlangdon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Snapshot files lgtm, approving for apm-python

@brettlangdon
Copy link
Member

a changelog entry should be added for this change.

Copy link
Contributor

@Yun-Kim Yun-Kim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small nits but otherwise LGTM once addressed!

@maxzhangdd maxzhangdd enabled auto-merge (squash) July 9, 2025 20:05
@maxzhangdd maxzhangdd merged commit b17d958 into main Jul 9, 2025
467 of 469 checks passed
@maxzhangdd maxzhangdd deleted the maxzhang/google-genai-embedcontent branch July 9, 2025 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants