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

chore(llmobs): token metrics name changes #9657

Merged
merged 5 commits into from
Jun 28, 2024

Conversation

lievan
Copy link
Contributor

@lievan lievan commented Jun 26, 2024

Makes the following updates to metric key names submitted to LLM Observability for openai & bedrock integrations

prompt_tokens -> input_tokens
completion_tokens -> output_tokens

The backend already has the changes in place to accept these updated key names so a hard cutover is OK.

A release note is not needed since metric key names used by our integrations (openai, langchain, bedrock) when submitting data to LLM Obs backend is an internal contract between the integration and backend.

When users set metric key names for manually created spans, our documentation already instructs them to use input/output terminology

Checklist

  • Change(s) are motivated and described in the PR description
  • Testing strategy is described if automated tests are not included in the PR
  • Risks are described (performance impact, potential for breakage, maintainability)
  • Change is maintainable (easy to change, telemetry, documentation)
  • Library release note guidelines are followed or label changelog/no-changelog is set
  • Documentation is included (in-code, generated user docs, public corp docs)
  • Backport labels are set (if applicable)
  • If this PR changes the public interface, I've notified @DataDog/apm-tees.

Reviewer Checklist

  • Title is accurate
  • All changes are related to the pull request's stated goal
  • Description motivates each change
  • Avoids breaking API changes
  • Testing strategy adequately addresses listed risks
  • Change is maintainable (easy to change, telemetry, documentation)
  • Release note makes sense to a user of the library
  • 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

@lievan lievan added the changelog/no-changelog A changelog entry is not required for this PR. label Jun 26, 2024
@datadog-dd-trace-py-rkomorn
Copy link

datadog-dd-trace-py-rkomorn bot commented Jun 26, 2024

Datadog Report

Branch report: evan.li/migrate-token-metric-key-names
Commit report: d614107
Test service: dd-trace-py

✅ 0 Failed, 5427 Passed, 34958 Skipped, 1h 58m 48.69s Total duration (6m 41s time saved)

@pr-commenter
Copy link

pr-commenter bot commented Jun 26, 2024

Benchmarks

Benchmark execution time: 2024-06-28 18:35:12

Comparing candidate commit d614107 in PR branch evan.li/migrate-token-metric-key-names with baseline commit 09b537d in branch main.

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

@lievan lievan marked this pull request as ready for review June 27, 2024 15:11
@lievan lievan requested review from a team as code owners June 27, 2024 15:11
@lievan lievan requested a review from erikayasuda June 27, 2024 15:11
@lievan lievan changed the title chore(llmobs): start token migration chore(llmobs): token metrics name changes Jun 27, 2024
Copy link
Contributor

@sabrenner sabrenner left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@Kyle-Verhoog
Copy link
Member

change is isolated to the llm obs product so I think this is good to merge

@lievan lievan enabled auto-merge (squash) June 28, 2024 13:15
@Kyle-Verhoog Kyle-Verhoog merged commit 65aca74 into main Jun 28, 2024
130 of 136 checks passed
@Kyle-Verhoog Kyle-Verhoog deleted the evan.li/migrate-token-metric-key-names branch June 28, 2024 19:50
tabgok pushed a commit that referenced this pull request Jul 11, 2024
Makes the following updates to metric key names submitted to LLM
Observability for openai & bedrock integrations

`prompt_tokens` -> `input_tokens`
`completion_tokens` -> `output_tokens`

The backend already has the changes in place to accept these updated key
names so a hard cutover is OK.

A release note is not needed since metric key names used by our
integrations (openai, langchain, bedrock) when submitting data to LLM
Obs backend is an internal contract between the integration and backend.

When users set metric key names for manually created spans, our
documentation already instructs them to use input/output terminology

## 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 <evan.li@datadoqhq.com>
Co-authored-by: kyle <kyle@verhoog.ca>
Copy link

The backport to 2.9 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.9 2.9
# Navigate to the new working tree
cd .worktrees/backport-2.9
# Create a new branch
git switch --create backport-9657-to-2.9
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 65aca749f5a08a65cbab80612d040ed0ff9204a3
# Push it to GitHub
git push --set-upstream origin backport-9657-to-2.9
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.9

Then, create a pull request where the base branch is 2.9 and the compare/head branch is backport-9657-to-2.9.

Copy link

The backport to 2.10 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.10 2.10
# Navigate to the new working tree
cd .worktrees/backport-2.10
# Create a new branch
git switch --create backport-9657-to-2.10
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 65aca749f5a08a65cbab80612d040ed0ff9204a3
# Push it to GitHub
git push --set-upstream origin backport-9657-to-2.10
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.10

Then, create a pull request where the base branch is 2.10 and the compare/head branch is backport-9657-to-2.10.

lievan added a commit that referenced this pull request Jul 11, 2024
Makes the following updates to metric key names submitted to LLM
Observability for openai & bedrock integrations

`prompt_tokens` -> `input_tokens`
`completion_tokens` -> `output_tokens`

The backend already has the changes in place to accept these updated key
names so a hard cutover is OK.

A release note is not needed since metric key names used by our
integrations (openai, langchain, bedrock) when submitting data to LLM
Obs backend is an internal contract between the integration and backend.

When users set metric key names for manually created spans, our
documentation already instructs them to use input/output terminology

- [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`.

- [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 <evan.li@datadoqhq.com>
Co-authored-by: kyle <kyle@verhoog.ca>
lievan added a commit that referenced this pull request Jul 11, 2024
Makes the following updates to metric key names submitted to LLM
Observability for openai & bedrock integrations

`prompt_tokens` -> `input_tokens`
`completion_tokens` -> `output_tokens`

The backend already has the changes in place to accept these updated key
names so a hard cutover is OK.

A release note is not needed since metric key names used by our
integrations (openai, langchain, bedrock) when submitting data to LLM
Obs backend is an internal contract between the integration and backend.

When users set metric key names for manually created spans, our
documentation already instructs them to use input/output terminology

- [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`.

- [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 <evan.li@datadoqhq.com>
Co-authored-by: kyle <kyle@verhoog.ca>
lievan added a commit that referenced this pull request Jul 12, 2024
…obs): token metrics name changes (#9657)

Makes the following updates to metric key names submitted to LLM
Observability for openai & bedrock integrations

`prompt_tokens` -> `input_tokens`
`completion_tokens` -> `output_tokens`

The backend already has the changes in place to accept these updated key
names so a hard cutover is OK.

A release note is not needed since metric key names used by our
integrations (openai, langchain, bedrock) when submitting data to LLM
Obs backend is an internal contract between the integration and backend.

When users set metric key names for manually created spans, our
documentation already instructs them to use input/output terminology

- [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`.

- [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 <evan.li@datadoqhq.com>
Co-authored-by: kyle <kyle@verhoog.ca>
lievan added a commit that referenced this pull request Jul 12, 2024
Makes the following updates to metric key names submitted to LLM
Observability for openai & bedrock integrations

`prompt_tokens` -> `input_tokens`
`completion_tokens` -> `output_tokens`

The backend already has the changes in place to accept these updated key
names so a hard cutover is OK.

A release note is not needed since metric key names used by our
integrations (openai, langchain, bedrock) when submitting data to LLM
Obs backend is an internal contract between the integration and backend.

When users set metric key names for manually created spans, our
documentation already instructs them to use input/output terminology

- [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`.

- [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 <evan.li@datadoqhq.com>
Co-authored-by: kyle <kyle@verhoog.ca>
lievan added a commit that referenced this pull request Jul 12, 2024
Makes the following updates to metric key names submitted to LLM
Observability for openai & bedrock integrations

`prompt_tokens` -> `input_tokens`
`completion_tokens` -> `output_tokens`

The backend already has the changes in place to accept these updated key
names so a hard cutover is OK.

A release note is not needed since metric key names used by our
integrations (openai, langchain, bedrock) when submitting data to LLM
Obs backend is an internal contract between the integration and backend.

When users set metric key names for manually created spans, our
documentation already instructs them to use input/output terminology

- [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`.

- [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 <evan.li@datadoqhq.com>
Co-authored-by: kyle <kyle@verhoog.ca>
Yun-Kim pushed a commit that referenced this pull request Jul 12, 2024
Manual backport for #9657

Backport allows us to remove logic in the backend which parses both
(prompt/completion_tokens) and (input/output_tokens) keys

## 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>
Co-authored-by: kyle <kyle@verhoog.ca>
Yun-Kim pushed a commit that referenced this pull request Jul 13, 2024
Manual backport for #9657 to
2.10

Backport allows us to remove logic in the backend which parses both
(prompt/completion_tokens) and (input/output_tokens) keys

## 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>
Co-authored-by: kyle <kyle@verhoog.ca>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.9 backport 2.10 changelog/no-changelog A changelog entry is not required for this PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants