From 3c943fcc07b7b2b80892f91463b881f641518aa2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 29 May 2024 20:02:02 +0000 Subject: [PATCH] chore(llmobs): increase default write timeout [backport 2.9] (#9439) Backport 69d1d3ce5ec00693cc2a18312b78ea509d64bb52 from #9438 to 2.9. Increase the default timeout for writing llmobs span evens and evaluation metrics. We've seen timeout errors with the default 2 seconds, so bump it to 5 to be more generous. ## Checklist - [x] Change(s) are motivated and described in the PR description - [x] Testing strategy is described if automated tests are not included in the PR - [x] Risks are described (performance impact, potential for breakage, maintainability) - [x] Change is maintainable (easy to change, telemetry, documentation) - [x] [Library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) are followed or label `changelog/no-changelog` is set - [x] Documentation is included (in-code, generated user docs, [public corp docs](https://github.com/DataDog/documentation/)) - [x] Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) - [x] If this PR changes the public interface, I've notified `@DataDog/apm-tees`. ## Reviewer Checklist - [x] Title is accurate - [x] All changes are related to the pull request's stated goal - [x] Description motivates each change - [x] Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes - [x] Testing strategy adequately addresses listed risks - [x] Change is maintainable (easy to change, telemetry, documentation) - [x] Release note makes sense to a user of the library - [x] Author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment - [x] Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting) Co-authored-by: lievan <42917263+lievan@users.noreply.github.com> --- ddtrace/llmobs/_llmobs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ddtrace/llmobs/_llmobs.py b/ddtrace/llmobs/_llmobs.py index cd731e72d30..6c6517fb2b6 100644 --- a/ddtrace/llmobs/_llmobs.py +++ b/ddtrace/llmobs/_llmobs.py @@ -65,13 +65,13 @@ def __init__(self, tracer=None): site=config._dd_site, api_key=config._dd_api_key, interval=float(os.getenv("_DD_LLMOBS_WRITER_INTERVAL", 1.0)), - timeout=float(os.getenv("_DD_LLMOBS_WRITER_TIMEOUT", 2.0)), + timeout=float(os.getenv("_DD_LLMOBS_WRITER_TIMEOUT", 5.0)), ) self._llmobs_eval_metric_writer = LLMObsEvalMetricWriter( site=config._dd_site, api_key=config._dd_api_key, interval=float(os.getenv("_DD_LLMOBS_WRITER_INTERVAL", 1.0)), - timeout=float(os.getenv("_DD_LLMOBS_WRITER_TIMEOUT", 2.0)), + timeout=float(os.getenv("_DD_LLMOBS_WRITER_TIMEOUT", 5.0)), ) def _start_service(self) -> None: