Skip to content

Nicole cybul/flaky test investigation6 #13275

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

Draft
wants to merge 66 commits into
base: main
Choose a base branch
from

Conversation

ncybul
Copy link
Contributor

@ncybul ncybul commented Apr 25, 2025

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 Apr 25, 2025

CODEOWNERS have been resolved as:

ddtrace/contrib/internal/litellm/utils.py                               @DataDog/apm-core-python @DataDog/apm-idm-python
releasenotes/notes/feat-llmobs-litellm-7fc73fd28ab88fac.yaml            @DataDog/apm-python
tests/contrib/litellm/cassettes/completion_multiple_choices_proxy.yaml  @DataDog/apm-core-python @DataDog/apm-idm-python
tests/contrib/litellm/cassettes/completion_multiple_choices_with_tools.yaml  @DataDog/apm-core-python @DataDog/apm-idm-python
tests/contrib/litellm/cassettes/completion_proxy.yaml                   @DataDog/apm-core-python @DataDog/apm-idm-python
tests/contrib/litellm/cassettes/completion_stream_exclude_usage.yaml    @DataDog/apm-core-python @DataDog/apm-idm-python
tests/contrib/litellm/cassettes/completion_stream_multiple_choices_exclude_usage.yaml  @DataDog/apm-core-python @DataDog/apm-idm-python
tests/contrib/litellm/cassettes/completion_stream_multiple_choices_proxy.yaml  @DataDog/apm-core-python @DataDog/apm-idm-python
tests/contrib/litellm/cassettes/completion_stream_multiple_choices_with_tools.yaml  @DataDog/apm-core-python @DataDog/apm-idm-python
tests/contrib/litellm/cassettes/completion_stream_proxy.yaml            @DataDog/apm-core-python @DataDog/apm-idm-python
tests/contrib/litellm/cassettes/completion_stream_with_tools.yaml       @DataDog/apm-core-python @DataDog/apm-idm-python
tests/contrib/litellm/cassettes/completion_with_tools.yaml              @DataDog/apm-core-python @DataDog/apm-idm-python
tests/contrib/litellm/test_litellm_llmobs.py                            @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/litellm/patch.py                               @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/openai/utils.py                                @DataDog/ml-observability
ddtrace/llmobs/_integrations/litellm.py                                 @DataDog/ml-observability
ddtrace/llmobs/_integrations/openai.py                                  @DataDog/ml-observability
ddtrace/llmobs/_integrations/utils.py                                   @DataDog/ml-observability
ddtrace/llmobs/_llmobs.py                                               @DataDog/ml-observability
riotfile.py                                                             @DataDog/apm-python
tests/contrib/litellm/conftest.py                                       @DataDog/apm-core-python @DataDog/apm-idm-python
tests/contrib/litellm/test_litellm.py                                   @DataDog/apm-core-python @DataDog/apm-idm-python
tests/contrib/litellm/utils.py                                          @DataDog/apm-core-python @DataDog/apm-idm-python
.riot/requirements/13b5e4d.txt                                          @DataDog/apm-python
.riot/requirements/1853780.txt                                          @DataDog/apm-python
.riot/requirements/18c9e95.txt                                          @DataDog/apm-python
.riot/requirements/2a7ee7f.txt                                          @DataDog/apm-python
.riot/requirements/d6de843.txt                                          @DataDog/apm-python

)

@staticmethod
def _extract_llmobs_metrics(resp: Any) -> Dict[str, Any]:
Copy link
Contributor

Choose a reason for hiding this comment

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

🟠 Code Quality Violation

do not use Any, use a concrete type (...read more)

Use the Any type very carefully. Most of the time, the Any type is used because we do not know exactly what type is being used. If you want to specify that a value can be of any type, use object instead of Any.

Learn More

View in Datadog  Leave us feedback  Documentation

@@ -284,6 +292,187 @@ def get_messages_from_converse_content(role: str, content: list):
return messages


def openai_set_meta_tags_from_completion(span: Span, kwargs: Dict[str, Any], completions: Any) -> None:
Copy link
Contributor

Choose a reason for hiding this comment

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

🟠 Code Quality Violation

do not use Any, use a concrete type (...read more)

Use the Any type very carefully. Most of the time, the Any type is used because we do not know exactly what type is being used. If you want to specify that a value can be of any type, use object instead of Any.

Learn More

View in Datadog  Leave us feedback  Documentation

Copy link
Contributor

github-actions bot commented Apr 25, 2025

Bootstrap import analysis

Comparison of import times between this PR and base.

Summary

The average import time from this PR is: 231 ± 2 ms.

The average import time from base is: 233 ± 2 ms.

The import time difference between this PR and base is: -1.95 ± 0.09 ms.

Import time breakdown

The following import paths have shrunk:

ddtrace.auto 1.998 ms (0.86%)
ddtrace.bootstrap.sitecustomize 1.298 ms (0.56%)
ddtrace.bootstrap.preload 1.298 ms (0.56%)
ddtrace.internal.products 1.298 ms (0.56%)
ddtrace.internal.remoteconfig.client 0.626 ms (0.27%)
ddtrace 0.700 ms (0.30%)
ddtrace._logger 0.031 ms (0.01%)
logging 0.031 ms (0.01%)
traceback 0.031 ms (0.01%)
contextlib 0.031 ms (0.01%)

@pr-commenter
Copy link

pr-commenter bot commented Apr 25, 2025

Benchmarks

Benchmark execution time: 2025-04-25 14:39:41

Comparing candidate commit e1b1d3a in PR branch nicole-cybul/flaky-test-investigation6 with baseline commit 6bbb551 in branch main.

Found 0 performance improvements and 3 performance regressions! Performance is the same for 498 metrics, 7 unstable metrics.

scenario:iast_aspects-ospathsplitext_aspect

  • 🟥 execution_time [+598.483ns; +728.327ns] or [+13.116%; +15.961%]

scenario:iast_aspects-replace_aspect

  • 🟥 execution_time [+424.920ns; +584.077ns] or [+9.158%; +12.589%]

scenario:iast_aspects-upper_aspect

  • 🟥 execution_time [+172.400ns; +217.025ns] or [+7.531%; +9.480%]

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.

1 participant