Skip to content
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

feat(openai): add model tag for openai metrics for consistency with openai saas integration #10282

Merged
merged 6 commits into from
Aug 22, 2024

Conversation

lievan
Copy link
Contributor

@lievan lievan commented Aug 19, 2024

Metrics from the OpenAI SaaS integration (openai.api.usage...) have a model tag. We should also tag metrics from OpenAI APM Integration with model for convenience (for example if customers want to use both openai.api.usage... metrics and openai.ratelimit... metrics in the same dashboard).

Addresses #10185

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

CODEOWNERS have been resolved as:

releasenotes/notes/openai-model-tag-2482b3d5b2905db9.yaml               @DataDog/apm-python
ddtrace/llmobs/_integrations/openai.py                                  @DataDog/ml-observability
tests/contrib/openai/test_openai_v0.py                                  @DataDog/ml-observability
tests/contrib/openai/test_openai_v1.py                                  @DataDog/ml-observability

@datadog-dd-trace-py-rkomorn
Copy link

datadog-dd-trace-py-rkomorn bot commented Aug 19, 2024

Datadog Report

Branch report: evan.li/openai-model-tag
Commit report: 5bc8bbd
Test service: dd-trace-py

✅ 0 Failed, 2500 Passed, 38487 Skipped, 28m 52.93s Total Time

@pr-commenter
Copy link

pr-commenter bot commented Aug 19, 2024

Benchmarks

Benchmark execution time: 2024-08-21 18:16:41

Comparing candidate commit 5bc8bbd in PR branch evan.li/openai-model-tag with baseline commit 4d1e946 in branch main.

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

@lievan lievan marked this pull request as ready for review August 19, 2024 22:07
@lievan lievan requested review from a team as code owners August 19, 2024 22:07
@lievan
Copy link
Contributor Author

lievan commented Aug 21, 2024

/merge

@dd-devflow
Copy link

dd-devflow bot commented Aug 21, 2024

🚂 MergeQueue: waiting for PR to be ready

This merge request is not mergeable yet, because of pending checks/missing approvals. It will be added to the queue as soon as checks pass and/or get approvals.
Note: if you pushed new commits since the last approval, you may need additional approval.
You can remove it from the waiting list with /remove command.

Use /merge -c to cancel this operation!

@dd-devflow
Copy link

dd-devflow bot commented Aug 21, 2024

🚂 MergeQueue: queue is disabled

Added to the queue but the mergequeue is not enabled for now.

Use /merge -c to cancel this operation!

@lievan lievan merged commit 07ecb27 into main Aug 22, 2024
157 of 159 checks passed
@lievan lievan deleted the evan.li/openai-model-tag branch August 22, 2024 13:34
@dd-devflow
Copy link

dd-devflow bot commented Aug 22, 2024

🚂 MergeQueue: This merge request was already merged

This pull request was merged directly.

github-actions bot pushed a commit that referenced this pull request Aug 26, 2024
…h openai saas integration (#10282)

Metrics from the OpenAI SaaS integration `(openai.api.usage...)` have a
`model` tag. We should also tag metrics from OpenAI APM Integration with
`model` for convenience (for example if customers want to use both
`openai.api.usage...` metrics and `openai.ratelimit...` metrics in the
same dashboard).

Addresses #10185

## Checklist
- [x] 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](https://ddtrace.readthedocs.io/en/stable/releasenotes.html)
- The change includes or references documentation updates if necessary
- Backport labels are set (if
[applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting))

## Reviewer Checklist
- [x] 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](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces)
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](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)

---------

Co-authored-by: lievan <evan.li@datadoqhq.com>
(cherry picked from commit 07ecb27)
github-actions bot pushed a commit that referenced this pull request Aug 26, 2024
…h openai saas integration (#10282)

Metrics from the OpenAI SaaS integration `(openai.api.usage...)` have a
`model` tag. We should also tag metrics from OpenAI APM Integration with
`model` for convenience (for example if customers want to use both
`openai.api.usage...` metrics and `openai.ratelimit...` metrics in the
same dashboard).

Addresses #10185

## Checklist
- [x] 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](https://ddtrace.readthedocs.io/en/stable/releasenotes.html)
- The change includes or references documentation updates if necessary
- Backport labels are set (if
[applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting))

## Reviewer Checklist
- [x] 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](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces)
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](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)

---------

Co-authored-by: lievan <evan.li@datadoqhq.com>
(cherry picked from commit 07ecb27)
github-actions bot pushed a commit that referenced this pull request Aug 26, 2024
…h openai saas integration (#10282)

Metrics from the OpenAI SaaS integration `(openai.api.usage...)` have a
`model` tag. We should also tag metrics from OpenAI APM Integration with
`model` for convenience (for example if customers want to use both
`openai.api.usage...` metrics and `openai.ratelimit...` metrics in the
same dashboard).

Addresses #10185

## Checklist
- [x] 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](https://ddtrace.readthedocs.io/en/stable/releasenotes.html)
- The change includes or references documentation updates if necessary
- Backport labels are set (if
[applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting))

## Reviewer Checklist
- [x] 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](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces)
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](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)

---------

Co-authored-by: lievan <evan.li@datadoqhq.com>
(cherry picked from commit 07ecb27)
Yun-Kim pushed a commit that referenced this pull request Aug 27, 2024
…h openai saas integration [backport 2.12] (#10384)

Backport 07ecb27 from #10282 to 2.12.

Metrics from the OpenAI SaaS integration `(openai.api.usage...)` have a
`model` tag. We should also tag metrics from OpenAI APM Integration with
`model` for convenience (for example if customers want to use both
`openai.api.usage...` metrics and `openai.ratelimit...` metrics in the
same dashboard).

Addresses #10185

## Checklist
- [x] 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](https://ddtrace.readthedocs.io/en/stable/releasenotes.html)
- The change includes or references documentation updates if necessary
- Backport labels are set (if
[applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting))

## Reviewer Checklist
- [x] 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](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces)
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](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)

Co-authored-by: lievan <42917263+lievan@users.noreply.github.com>
Yun-Kim added a commit that referenced this pull request Aug 27, 2024
…h openai saas integration [backport 2.11] (#10382)

Backport 07ecb27 from #10282 to 2.11.

Metrics from the OpenAI SaaS integration `(openai.api.usage...)` have a
`model` tag. We should also tag metrics from OpenAI APM Integration with
`model` for convenience (for example if customers want to use both
`openai.api.usage...` metrics and `openai.ratelimit...` metrics in the
same dashboard).

Addresses #10185

## Checklist
- [x] 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](https://ddtrace.readthedocs.io/en/stable/releasenotes.html)
- The change includes or references documentation updates if necessary
- Backport labels are set (if
[applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting))

## Reviewer Checklist
- [x] 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](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces)
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](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)

Co-authored-by: lievan <42917263+lievan@users.noreply.github.com>
Co-authored-by: Yun Kim <35776586+Yun-Kim@users.noreply.github.com>
brettlangdon pushed a commit that referenced this pull request Sep 3, 2024
…h openai saas integration [backport 2.10] (#10383)

Backport 07ecb27 from #10282 to 2.10.

Metrics from the OpenAI SaaS integration `(openai.api.usage...)` have a
`model` tag. We should also tag metrics from OpenAI APM Integration with
`model` for convenience (for example if customers want to use both
`openai.api.usage...` metrics and `openai.ratelimit...` metrics in the
same dashboard).

Addresses #10185

## Checklist
- [x] 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](https://ddtrace.readthedocs.io/en/stable/releasenotes.html)
- The change includes or references documentation updates if necessary
- Backport labels are set (if
[applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting))

## Reviewer Checklist
- [x] 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](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces)
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](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)

Co-authored-by: lievan <42917263+lievan@users.noreply.github.com>
Co-authored-by: Yun Kim <35776586+Yun-Kim@users.noreply.github.com>
@Yun-Kim Yun-Kim changed the title chore(openai): add model tag for openai metrics for consistency with openai saas integration feat(openai): add model tag for openai metrics for consistency with openai saas integration Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants