-
Notifications
You must be signed in to change notification settings - Fork 442
chore(llmobs): dac strip io from vertex #13693
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
base: main
Are you sure you want to change the base?
Conversation
|
Bootstrap import analysisComparison of import times between this PR and base. SummaryThe average import time from this PR is: 281 ± 5 ms. The average import time from base is: 281 ± 5 ms. The import time difference between this PR and base is: 0.1 ± 0.2 ms. The difference is not statistically significant (z = 0.27). Import time breakdownThe following import paths have shrunk:
|
BenchmarksBenchmark execution time: 2025-06-25 15:29:34 Comparing candidate commit 1e5ac47 in PR branch Found 0 performance improvements and 2 performance regressions! Performance is the same for 559 metrics, 3 unstable metrics. scenario:iastaspects-replace_aspect
scenario:iastaspectsospath-ospathsplitdrive_aspect
|
@@ -3,6 +3,7 @@ | |||
from typing import Dict | |||
|
|||
import vertexai | |||
from vertexai.generative_models import GenerativeModel # noqa:F401 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing this import (which used to exist on ./_utils.py
but is no longer used there) breaks tests. As far as I can tell, it may have to do with vertex lazy loading, meaning that .generative_models
may not exist yet when patching.
If this is a known thing that we have a standard way to deal with, let me know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm interesting, I would probably put this import in the patch function directly (as long as that works) so that we only import it when we actually do the patching.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still fails. Looking closer, it will actually fail on the assertion that we are unpatched before calling .patch, since the thing we check isn't imported. There might be a way to move this to the test itself (a little tricky since its the base tests, not the vertex ones). Do you think that would be worth it?
tests/snapshots/tests.contrib.vertexai.test_vertexai.test_vertexai_completion_stream_tool.json
Outdated
Show resolved
Hide resolved
from vertexai.generative_models import GenerativeModel | ||
from vertexai.generative_models import Part | ||
|
||
from ddtrace.internal.utils import get_argument_value | ||
from ddtrace.llmobs._integrations.utils import get_generation_config_google | ||
from ddtrace.llmobs._integrations.utils import get_system_instructions_from_google_model | ||
from ddtrace.llmobs._integrations.utils import tag_request_content_part_google | ||
from ddtrace.llmobs._integrations.utils import tag_response_part_google |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we are still using these helpers in the google generative ai integration. Once we remove the APM tagging there, we can get rid of these helpers altogether :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a few comments which should hopefully be quick. Going to approve for now, but if there's anything you are unsure about, feel free to reach out for another review!
This should probably get a release note? |
@@ -177,6 +175,8 @@ tests/contrib/crewai @DataDog/ml-observ | |||
tests/contrib/openai_agents @DataDog/ml-observability | |||
tests/contrib/litellm @DataDog/ml-observability | |||
.gitlab/tests/llmobs.yml @DataDog/ml-observability | |||
# MLObs snapshot tests | |||
tests/snapshots/tests.contrib.vertexai.* @DataDog/apm-python @DataDog/ml-observability |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think apm-python
needs to be included on this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ended up pulling this into its own pr to reassign all the llmobs integration test snapshots; with your feedback integrated
Remove potentially sensitive i/o data from apm spans. This way, prompt and completion data will only appear on the llm obs spans, which are/will be subject to data access controls.
Mostly, this just removes io tag sets. A few things (mostly metrics) have llmobs tags dependent on span tags, so there is a bit more refactoring there.
Let me know if I removed anything that should really stay, or if I missed something that should be restricted.
Checklist
Reviewer Checklist