Skip to content

Commit 81be3fe

Browse files
fix(openai): update metric names in docs [backport #5809 to 1.13] (#5817)
Backports #5809 to 1.13. This PR fixes the openai patch docs to include the api_key span tag, as well as adding a missing `openai.organization.` to the org name and org id span tags. ## 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] Risk is outlined (performance impact, potential for breakage, maintainability, etc). - [x] Change is maintainable (easy to change, telemetry, documentation). - [x] [Library release note guidelines](https://ddtrace.readthedocs.io/en/stable/contributing.html#Release-Note-Guidelines) are followed. - [x] Documentation is included (in-code, generated user docs, [public corp docs](https://github.com/DataDog/documentation/)). - [x] OPTIONAL: PR description includes explicit acknowledgement of the performance implications of the change as reported in the benchmarks PR comment. ## Reviewer Checklist - [x] Title is accurate. - [x] No unnecessary changes are introduced. - [x] Description motivates each change. - [x] Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes unless absolutely necessary. - [x] Testing strategy adequately addresses listed risk(s). - [x] Change is maintainable (easy to change, telemetry, documentation). - [x] Release note makes sense to a user of the library. - [x] Reviewer has explicitly acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment. Co-authored-by: Kyle Verhoog <[email protected]>
1 parent 2e12b6b commit 81be3fe

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ddtrace/contrib/openai/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
traces, and logs (logs are disabled by default) for requests made to the
44
completions, chat completions, and embeddings endpoints.
55
6-
All metrics, logs, and traces submitted from the OpenAI integration are tagged with:
6+
All metrics, logs, and traces submitted from the OpenAI integration are tagged by:
77
88
- ``service``, ``env``, ``version``: see the `Unified Service Tagging docs <https://docs.datadoghq.com/getting_started/tagging/unified_service_tagging>`_.
99
- ``endpoint``: OpenAI API endpoint used in the request.
1010
- ``model``: OpenAI model used in the request.
11-
- ``organization.name``: OpenAI organization name used in the request.
12-
- ``organization.id``: OpenAI organization ID used in the request (when available).
11+
- ``openai.organization.name``: OpenAI organization name used in the request.
12+
- ``openai.organization.id``: OpenAI organization ID used in the request (when available).
13+
- ``openai.api_key``: OpenAI API key used to make the request (obfuscated to match the OpenAI UI representation ``sk-...XXXX`` where ``XXXX`` is the last 4 digits of the key).
1314
1415
1516
Metrics

0 commit comments

Comments
 (0)