From d383d52eee6dafa67d2453dcf0db9052f589ae3b Mon Sep 17 00:00:00 2001 From: basil-k-aji-dev <70605804+basil-k-aji-dev@users.noreply.github.com> Date: Wed, 25 Nov 2026 03:29:09 +0530 Subject: [PATCH] fix(openai): report cache write tokens as prompt_cache_creation_tokens --- .changeset/openai-cache-creation-metric.md | 5 ++ .../openai-v4-auto-hook.span-tree.json | 14 ++--- .../openai-v4-auto-hook.span-tree.txt | 14 ++--- .../openai-v4-latest-auto-hook.span-tree.json | 14 ++--- .../openai-v4-latest-auto-hook.span-tree.txt | 14 ++--- .../openai-v4-latest-wrapped.span-tree.json | 14 ++--- .../openai-v4-latest-wrapped.span-tree.txt | 14 ++--- .../openai-v4-wrapped.span-tree.json | 14 ++--- .../openai-v4-wrapped.span-tree.txt | 14 ++--- .../openai-v5-auto-hook.span-tree.json | 14 ++--- .../openai-v5-auto-hook.span-tree.txt | 14 ++--- .../openai-v5-latest-auto-hook.span-tree.json | 14 ++--- .../openai-v5-latest-auto-hook.span-tree.txt | 14 ++--- .../openai-v5-latest-wrapped.span-tree.json | 14 ++--- .../openai-v5-latest-wrapped.span-tree.txt | 14 ++--- .../openai-v5-wrapped.span-tree.json | 14 ++--- .../openai-v5-wrapped.span-tree.txt | 14 ++--- .../openai-v6-auto-hook.span-tree.json | 16 +++--- .../openai-v6-auto-hook.span-tree.txt | 16 +++--- .../openai-v6-latest-auto-hook.span-tree.json | 16 +++--- .../openai-v6-latest-auto-hook.span-tree.txt | 16 +++--- .../openai-v6-latest-wrapped.span-tree.json | 16 +++--- .../openai-v6-latest-wrapped.span-tree.txt | 16 +++--- .../openai-v6-wrapped.span-tree.json | 16 +++--- .../openai-v6-wrapped.span-tree.txt | 16 +++--- .../openai-v7-auto-hook.span-tree.json | 26 +++++----- .../openai-v7-auto-hook.span-tree.txt | 26 +++++----- .../openai-v7-latest-auto-hook.span-tree.json | 26 +++++----- .../openai-v7-latest-auto-hook.span-tree.txt | 26 +++++----- .../openai-v7-latest-wrapped.span-tree.json | 26 +++++----- .../openai-v7-latest-wrapped.span-tree.txt | 26 +++++----- .../openai-v7-wrapped.span-tree.json | 26 +++++----- .../openai-v7-wrapped.span-tree.txt | 26 +++++----- .../providers/openai-decisions.test.ts | 2 +- .../providers/openai-instrumentation.test.ts | 51 +++++++++++++++++++ js/src/openai-utils.ts | 6 +++ 36 files changed, 343 insertions(+), 281 deletions(-) create mode 100644 .changeset/openai-cache-creation-metric.md diff --git a/.changeset/openai-cache-creation-metric.md b/.changeset/openai-cache-creation-metric.md new file mode 100644 index 000000000..d4b69220f --- /dev/null +++ b/.changeset/openai-cache-creation-metric.md @@ -0,0 +1,5 @@ +--- +"braintrust": patch +--- + +fix(openai): report cache write tokens as prompt_cache_creation_tokens diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-auto-hook.span-tree.json b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-auto-hook.span-tree.json index 3dd2bdf51..0bfe59a00 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-auto-hook.span-tree.json +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-auto-hook.span-tree.json @@ -1859,7 +1859,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 4, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 13, "time_to_first_token": 0, @@ -1970,7 +1970,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 2, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 21, "time_to_first_token": 0, @@ -2078,7 +2078,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 4, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 13, "time_to_first_token": 0, @@ -2185,7 +2185,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 2, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 21, "time_to_first_token": 0, @@ -2316,7 +2316,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 16, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 19, "time_to_first_token": 0, @@ -2426,7 +2426,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 16, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 20, "time_to_first_token": 0, @@ -2556,7 +2556,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 16, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 46, "time_to_first_token": 0, diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-auto-hook.span-tree.txt b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-auto-hook.span-tree.txt index 58babe846..214429207 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-auto-hook.span-tree.txt +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-auto-hook.span-tree.txt @@ -1637,7 +1637,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 4, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 13, │ │ "time_to_first_token": 0, @@ -1740,7 +1740,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 2, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 21, │ │ "time_to_first_token": 0, @@ -1840,7 +1840,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 4, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 13, │ │ "time_to_first_token": 0, @@ -1939,7 +1939,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 2, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 21, │ │ "time_to_first_token": 0, @@ -2054,7 +2054,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 16, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 19, │ │ "time_to_first_token": 0, @@ -2156,7 +2156,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 16, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 20, │ │ "time_to_first_token": 0, @@ -2278,7 +2278,7 @@ span_tree: │ metrics: { │ "completion_reasoning_tokens": 0, │ "completion_tokens": 16, -│ "prompt_cache_write_tokens": 0, +│ "prompt_cache_creation_tokens": 0, │ "prompt_cached_tokens": 0, │ "prompt_tokens": 46, │ "time_to_first_token": 0, diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-latest-auto-hook.span-tree.json b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-latest-auto-hook.span-tree.json index f352f503a..415569c45 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-latest-auto-hook.span-tree.json +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-latest-auto-hook.span-tree.json @@ -1859,7 +1859,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 3, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 13, "time_to_first_token": 0, @@ -1970,7 +1970,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 2, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 21, "time_to_first_token": 0, @@ -2078,7 +2078,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 5, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 13, "time_to_first_token": 0, @@ -2185,7 +2185,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 2, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 21, "time_to_first_token": 0, @@ -2316,7 +2316,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 16, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 19, "time_to_first_token": 0, @@ -2426,7 +2426,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 16, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 20, "time_to_first_token": 0, @@ -2556,7 +2556,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 22, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 46, "time_to_first_token": 0, diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-latest-auto-hook.span-tree.txt b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-latest-auto-hook.span-tree.txt index 8ab66b0e6..6b36b2554 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-latest-auto-hook.span-tree.txt +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-latest-auto-hook.span-tree.txt @@ -1637,7 +1637,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 3, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 13, │ │ "time_to_first_token": 0, @@ -1740,7 +1740,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 2, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 21, │ │ "time_to_first_token": 0, @@ -1840,7 +1840,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 5, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 13, │ │ "time_to_first_token": 0, @@ -1939,7 +1939,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 2, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 21, │ │ "time_to_first_token": 0, @@ -2054,7 +2054,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 16, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 19, │ │ "time_to_first_token": 0, @@ -2156,7 +2156,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 16, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 20, │ │ "time_to_first_token": 0, @@ -2278,7 +2278,7 @@ span_tree: │ metrics: { │ "completion_reasoning_tokens": 0, │ "completion_tokens": 22, -│ "prompt_cache_write_tokens": 0, +│ "prompt_cache_creation_tokens": 0, │ "prompt_cached_tokens": 0, │ "prompt_tokens": 46, │ "time_to_first_token": 0, diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-latest-wrapped.span-tree.json b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-latest-wrapped.span-tree.json index 3298ba961..1aa84e248 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-latest-wrapped.span-tree.json +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-latest-wrapped.span-tree.json @@ -1851,7 +1851,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 3, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 13, "time_to_first_token": 0, @@ -1962,7 +1962,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 2, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 21, "time_to_first_token": 0, @@ -2070,7 +2070,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 5, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 13, "time_to_first_token": 0, @@ -2177,7 +2177,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 2, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 21, "time_to_first_token": 0, @@ -2308,7 +2308,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 16, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 19, "time_to_first_token": 0, @@ -2418,7 +2418,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 16, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 20, "time_to_first_token": 0, @@ -2556,7 +2556,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 22, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 46, "time_to_first_token": 0, diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-latest-wrapped.span-tree.txt b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-latest-wrapped.span-tree.txt index 9b9fe8cb6..e08a2991d 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-latest-wrapped.span-tree.txt +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-latest-wrapped.span-tree.txt @@ -1629,7 +1629,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 3, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 13, │ │ "time_to_first_token": 0, @@ -1732,7 +1732,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 2, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 21, │ │ "time_to_first_token": 0, @@ -1832,7 +1832,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 5, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 13, │ │ "time_to_first_token": 0, @@ -1931,7 +1931,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 2, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 21, │ │ "time_to_first_token": 0, @@ -2046,7 +2046,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 16, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 19, │ │ "time_to_first_token": 0, @@ -2148,7 +2148,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 16, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 20, │ │ "time_to_first_token": 0, @@ -2278,7 +2278,7 @@ span_tree: │ metrics: { │ "completion_reasoning_tokens": 0, │ "completion_tokens": 22, -│ "prompt_cache_write_tokens": 0, +│ "prompt_cache_creation_tokens": 0, │ "prompt_cached_tokens": 0, │ "prompt_tokens": 46, │ "time_to_first_token": 0, diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-wrapped.span-tree.json b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-wrapped.span-tree.json index 989e77fcb..1a0e3e74c 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-wrapped.span-tree.json +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-wrapped.span-tree.json @@ -1851,7 +1851,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 4, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 13, "time_to_first_token": 0, @@ -1962,7 +1962,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 2, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 21, "time_to_first_token": 0, @@ -2070,7 +2070,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 4, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 13, "time_to_first_token": 0, @@ -2177,7 +2177,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 2, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 21, "time_to_first_token": 0, @@ -2308,7 +2308,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 16, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 19, "time_to_first_token": 0, @@ -2418,7 +2418,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 16, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 20, "time_to_first_token": 0, @@ -2556,7 +2556,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 16, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 46, "time_to_first_token": 0, diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-wrapped.span-tree.txt b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-wrapped.span-tree.txt index 679e3f1c2..ed18eb7e9 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-wrapped.span-tree.txt +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-wrapped.span-tree.txt @@ -1629,7 +1629,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 4, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 13, │ │ "time_to_first_token": 0, @@ -1732,7 +1732,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 2, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 21, │ │ "time_to_first_token": 0, @@ -1832,7 +1832,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 4, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 13, │ │ "time_to_first_token": 0, @@ -1931,7 +1931,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 2, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 21, │ │ "time_to_first_token": 0, @@ -2046,7 +2046,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 16, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 19, │ │ "time_to_first_token": 0, @@ -2148,7 +2148,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 16, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 20, │ │ "time_to_first_token": 0, @@ -2278,7 +2278,7 @@ span_tree: │ metrics: { │ "completion_reasoning_tokens": 0, │ "completion_tokens": 16, -│ "prompt_cache_write_tokens": 0, +│ "prompt_cache_creation_tokens": 0, │ "prompt_cached_tokens": 0, │ "prompt_tokens": 46, │ "time_to_first_token": 0, diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-auto-hook.span-tree.json b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-auto-hook.span-tree.json index 5577f6890..9a1983f3f 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-auto-hook.span-tree.json +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-auto-hook.span-tree.json @@ -1985,7 +1985,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 3, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 13, "time_to_first_token": 0, @@ -2096,7 +2096,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 2, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 21, "time_to_first_token": 0, @@ -2204,7 +2204,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 5, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 13, "time_to_first_token": 0, @@ -2311,7 +2311,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 2, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 21, "time_to_first_token": 0, @@ -2442,7 +2442,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 16, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 19, "time_to_first_token": 0, @@ -2552,7 +2552,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 16, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 20, "time_to_first_token": 0, @@ -2682,7 +2682,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 26, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 46, "time_to_first_token": 0, diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-auto-hook.span-tree.txt b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-auto-hook.span-tree.txt index 8e416f1bf..6fabd9728 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-auto-hook.span-tree.txt +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-auto-hook.span-tree.txt @@ -1747,7 +1747,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 3, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 13, │ │ "time_to_first_token": 0, @@ -1850,7 +1850,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 2, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 21, │ │ "time_to_first_token": 0, @@ -1950,7 +1950,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 5, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 13, │ │ "time_to_first_token": 0, @@ -2049,7 +2049,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 2, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 21, │ │ "time_to_first_token": 0, @@ -2164,7 +2164,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 16, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 19, │ │ "time_to_first_token": 0, @@ -2266,7 +2266,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 16, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 20, │ │ "time_to_first_token": 0, @@ -2388,7 +2388,7 @@ span_tree: │ metrics: { │ "completion_reasoning_tokens": 0, │ "completion_tokens": 26, -│ "prompt_cache_write_tokens": 0, +│ "prompt_cache_creation_tokens": 0, │ "prompt_cached_tokens": 0, │ "prompt_tokens": 46, │ "time_to_first_token": 0, diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-latest-auto-hook.span-tree.json b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-latest-auto-hook.span-tree.json index 5abb34a04..95ad60df8 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-latest-auto-hook.span-tree.json +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-latest-auto-hook.span-tree.json @@ -1985,7 +1985,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 3, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 13, "time_to_first_token": 0, @@ -2096,7 +2096,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 2, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 21, "time_to_first_token": 0, @@ -2204,7 +2204,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 4, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 13, "time_to_first_token": 0, @@ -2311,7 +2311,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 2, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 21, "time_to_first_token": 0, @@ -2442,7 +2442,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 16, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 19, "time_to_first_token": 0, @@ -2552,7 +2552,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 16, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 20, "time_to_first_token": 0, @@ -2682,7 +2682,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 35, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 46, "time_to_first_token": 0, diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-latest-auto-hook.span-tree.txt b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-latest-auto-hook.span-tree.txt index 9791b46b6..963c310cd 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-latest-auto-hook.span-tree.txt +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-latest-auto-hook.span-tree.txt @@ -1747,7 +1747,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 3, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 13, │ │ "time_to_first_token": 0, @@ -1850,7 +1850,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 2, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 21, │ │ "time_to_first_token": 0, @@ -1950,7 +1950,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 4, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 13, │ │ "time_to_first_token": 0, @@ -2049,7 +2049,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 2, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 21, │ │ "time_to_first_token": 0, @@ -2164,7 +2164,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 16, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 19, │ │ "time_to_first_token": 0, @@ -2266,7 +2266,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 16, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 20, │ │ "time_to_first_token": 0, @@ -2388,7 +2388,7 @@ span_tree: │ metrics: { │ "completion_reasoning_tokens": 0, │ "completion_tokens": 35, -│ "prompt_cache_write_tokens": 0, +│ "prompt_cache_creation_tokens": 0, │ "prompt_cached_tokens": 0, │ "prompt_tokens": 46, │ "time_to_first_token": 0, diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-latest-wrapped.span-tree.json b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-latest-wrapped.span-tree.json index 98072006b..9d81ff26c 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-latest-wrapped.span-tree.json +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-latest-wrapped.span-tree.json @@ -1977,7 +1977,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 3, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 13, "time_to_first_token": 0, @@ -2088,7 +2088,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 2, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 21, "time_to_first_token": 0, @@ -2196,7 +2196,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 4, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 13, "time_to_first_token": 0, @@ -2303,7 +2303,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 2, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 21, "time_to_first_token": 0, @@ -2434,7 +2434,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 16, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 19, "time_to_first_token": 0, @@ -2544,7 +2544,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 16, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 20, "time_to_first_token": 0, @@ -2682,7 +2682,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 35, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 46, "time_to_first_token": 0, diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-latest-wrapped.span-tree.txt b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-latest-wrapped.span-tree.txt index dcdc38aac..f8620cfb6 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-latest-wrapped.span-tree.txt +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-latest-wrapped.span-tree.txt @@ -1739,7 +1739,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 3, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 13, │ │ "time_to_first_token": 0, @@ -1842,7 +1842,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 2, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 21, │ │ "time_to_first_token": 0, @@ -1942,7 +1942,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 4, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 13, │ │ "time_to_first_token": 0, @@ -2041,7 +2041,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 2, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 21, │ │ "time_to_first_token": 0, @@ -2156,7 +2156,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 16, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 19, │ │ "time_to_first_token": 0, @@ -2258,7 +2258,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 16, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 20, │ │ "time_to_first_token": 0, @@ -2388,7 +2388,7 @@ span_tree: │ metrics: { │ "completion_reasoning_tokens": 0, │ "completion_tokens": 35, -│ "prompt_cache_write_tokens": 0, +│ "prompt_cache_creation_tokens": 0, │ "prompt_cached_tokens": 0, │ "prompt_tokens": 46, │ "time_to_first_token": 0, diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-wrapped.span-tree.json b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-wrapped.span-tree.json index 018212a98..0980e23a4 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-wrapped.span-tree.json +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-wrapped.span-tree.json @@ -1977,7 +1977,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 3, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 13, "time_to_first_token": 0, @@ -2088,7 +2088,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 2, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 21, "time_to_first_token": 0, @@ -2196,7 +2196,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 5, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 13, "time_to_first_token": 0, @@ -2303,7 +2303,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 2, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 21, "time_to_first_token": 0, @@ -2434,7 +2434,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 16, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 19, "time_to_first_token": 0, @@ -2544,7 +2544,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 16, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 20, "time_to_first_token": 0, @@ -2682,7 +2682,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 26, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 46, "time_to_first_token": 0, diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-wrapped.span-tree.txt b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-wrapped.span-tree.txt index 9fe71d44c..2a318387d 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-wrapped.span-tree.txt +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-wrapped.span-tree.txt @@ -1739,7 +1739,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 3, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 13, │ │ "time_to_first_token": 0, @@ -1842,7 +1842,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 2, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 21, │ │ "time_to_first_token": 0, @@ -1942,7 +1942,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 5, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 13, │ │ "time_to_first_token": 0, @@ -2041,7 +2041,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 2, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 21, │ │ "time_to_first_token": 0, @@ -2156,7 +2156,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 16, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 19, │ │ "time_to_first_token": 0, @@ -2258,7 +2258,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 16, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 20, │ │ "time_to_first_token": 0, @@ -2388,7 +2388,7 @@ span_tree: │ metrics: { │ "completion_reasoning_tokens": 0, │ "completion_tokens": 26, -│ "prompt_cache_write_tokens": 0, +│ "prompt_cache_creation_tokens": 0, │ "prompt_cached_tokens": 0, │ "prompt_tokens": 46, │ "time_to_first_token": 0, diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-auto-hook.span-tree.json b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-auto-hook.span-tree.json index b441137dd..261d063bf 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-auto-hook.span-tree.json +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-auto-hook.span-tree.json @@ -2132,7 +2132,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 3, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 13, "time_to_first_token": 0, @@ -2243,7 +2243,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 2, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 21, "time_to_first_token": 0, @@ -2351,7 +2351,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 4, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 13, "time_to_first_token": 0, @@ -2458,7 +2458,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 2, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 21, "time_to_first_token": 0, @@ -2589,7 +2589,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 16, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 19, "time_to_first_token": 0, @@ -2699,7 +2699,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 16, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 20, "time_to_first_token": 0, @@ -2829,7 +2829,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 17, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 46, "time_to_first_token": 0, @@ -2904,7 +2904,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 204, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 133, "time_to_first_token": 0, diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-auto-hook.span-tree.txt b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-auto-hook.span-tree.txt index 63501bde6..0a52796a5 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-auto-hook.span-tree.txt +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-auto-hook.span-tree.txt @@ -1878,7 +1878,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 3, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 13, │ │ "time_to_first_token": 0, @@ -1981,7 +1981,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 2, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 21, │ │ "time_to_first_token": 0, @@ -2081,7 +2081,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 4, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 13, │ │ "time_to_first_token": 0, @@ -2180,7 +2180,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 2, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 21, │ │ "time_to_first_token": 0, @@ -2295,7 +2295,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 16, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 19, │ │ "time_to_first_token": 0, @@ -2397,7 +2397,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 16, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 20, │ │ "time_to_first_token": 0, @@ -2519,7 +2519,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 17, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 46, │ │ "time_to_first_token": 0, @@ -2586,7 +2586,7 @@ span_tree: │ metrics: { │ "completion_reasoning_tokens": 0, │ "completion_tokens": 204, -│ "prompt_cache_write_tokens": 0, +│ "prompt_cache_creation_tokens": 0, │ "prompt_cached_tokens": 0, │ "prompt_tokens": 133, │ "time_to_first_token": 0, diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-latest-auto-hook.span-tree.json b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-latest-auto-hook.span-tree.json index 89d2d818e..bcea61249 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-latest-auto-hook.span-tree.json +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-latest-auto-hook.span-tree.json @@ -2132,7 +2132,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 4, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 13, "time_to_first_token": 0, @@ -2243,7 +2243,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 2, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 21, "time_to_first_token": 0, @@ -2351,7 +2351,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 4, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 13, "time_to_first_token": 0, @@ -2458,7 +2458,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 2, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 21, "time_to_first_token": 0, @@ -2589,7 +2589,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 16, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 19, "time_to_first_token": 0, @@ -2699,7 +2699,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 16, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 20, "time_to_first_token": 0, @@ -2829,7 +2829,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 24, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 46, "time_to_first_token": 0, @@ -2904,7 +2904,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 235, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 133, "time_to_first_token": 0, diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-latest-auto-hook.span-tree.txt b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-latest-auto-hook.span-tree.txt index 717449a16..c74b3f4f1 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-latest-auto-hook.span-tree.txt +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-latest-auto-hook.span-tree.txt @@ -1878,7 +1878,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 4, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 13, │ │ "time_to_first_token": 0, @@ -1981,7 +1981,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 2, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 21, │ │ "time_to_first_token": 0, @@ -2081,7 +2081,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 4, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 13, │ │ "time_to_first_token": 0, @@ -2180,7 +2180,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 2, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 21, │ │ "time_to_first_token": 0, @@ -2295,7 +2295,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 16, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 19, │ │ "time_to_first_token": 0, @@ -2397,7 +2397,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 16, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 20, │ │ "time_to_first_token": 0, @@ -2519,7 +2519,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 24, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 46, │ │ "time_to_first_token": 0, @@ -2586,7 +2586,7 @@ span_tree: │ metrics: { │ "completion_reasoning_tokens": 0, │ "completion_tokens": 235, -│ "prompt_cache_write_tokens": 0, +│ "prompt_cache_creation_tokens": 0, │ "prompt_cached_tokens": 0, │ "prompt_tokens": 133, │ "time_to_first_token": 0, diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-latest-wrapped.span-tree.json b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-latest-wrapped.span-tree.json index 60eecb476..ff1026c3f 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-latest-wrapped.span-tree.json +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-latest-wrapped.span-tree.json @@ -2124,7 +2124,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 4, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 13, "time_to_first_token": 0, @@ -2235,7 +2235,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 2, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 21, "time_to_first_token": 0, @@ -2343,7 +2343,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 4, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 13, "time_to_first_token": 0, @@ -2450,7 +2450,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 2, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 21, "time_to_first_token": 0, @@ -2581,7 +2581,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 16, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 19, "time_to_first_token": 0, @@ -2691,7 +2691,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 16, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 20, "time_to_first_token": 0, @@ -2829,7 +2829,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 24, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 46, "time_to_first_token": 0, @@ -2904,7 +2904,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 235, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 133, "time_to_first_token": 0, diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-latest-wrapped.span-tree.txt b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-latest-wrapped.span-tree.txt index 85b92bdca..ee8506e5e 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-latest-wrapped.span-tree.txt +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-latest-wrapped.span-tree.txt @@ -1870,7 +1870,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 4, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 13, │ │ "time_to_first_token": 0, @@ -1973,7 +1973,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 2, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 21, │ │ "time_to_first_token": 0, @@ -2073,7 +2073,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 4, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 13, │ │ "time_to_first_token": 0, @@ -2172,7 +2172,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 2, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 21, │ │ "time_to_first_token": 0, @@ -2287,7 +2287,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 16, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 19, │ │ "time_to_first_token": 0, @@ -2389,7 +2389,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 16, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 20, │ │ "time_to_first_token": 0, @@ -2519,7 +2519,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 24, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 46, │ │ "time_to_first_token": 0, @@ -2586,7 +2586,7 @@ span_tree: │ metrics: { │ "completion_reasoning_tokens": 0, │ "completion_tokens": 235, -│ "prompt_cache_write_tokens": 0, +│ "prompt_cache_creation_tokens": 0, │ "prompt_cached_tokens": 0, │ "prompt_tokens": 133, │ "time_to_first_token": 0, diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-wrapped.span-tree.json b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-wrapped.span-tree.json index dd02aa837..ded5086cf 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-wrapped.span-tree.json +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-wrapped.span-tree.json @@ -2124,7 +2124,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 3, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 13, "time_to_first_token": 0, @@ -2235,7 +2235,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 2, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 21, "time_to_first_token": 0, @@ -2343,7 +2343,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 4, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 13, "time_to_first_token": 0, @@ -2450,7 +2450,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 2, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 21, "time_to_first_token": 0, @@ -2581,7 +2581,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 16, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 19, "time_to_first_token": 0, @@ -2691,7 +2691,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 16, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 20, "time_to_first_token": 0, @@ -2829,7 +2829,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 17, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 46, "time_to_first_token": 0, @@ -2904,7 +2904,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 204, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 133, "time_to_first_token": 0, diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-wrapped.span-tree.txt b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-wrapped.span-tree.txt index 1579bdad4..63fb9e7d5 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-wrapped.span-tree.txt +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-wrapped.span-tree.txt @@ -1870,7 +1870,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 3, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 13, │ │ "time_to_first_token": 0, @@ -1973,7 +1973,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 2, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 21, │ │ "time_to_first_token": 0, @@ -2073,7 +2073,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 4, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 13, │ │ "time_to_first_token": 0, @@ -2172,7 +2172,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 2, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 21, │ │ "time_to_first_token": 0, @@ -2287,7 +2287,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 16, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 19, │ │ "time_to_first_token": 0, @@ -2389,7 +2389,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 16, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 20, │ │ "time_to_first_token": 0, @@ -2519,7 +2519,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 17, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 46, │ │ "time_to_first_token": 0, @@ -2586,7 +2586,7 @@ span_tree: │ metrics: { │ "completion_reasoning_tokens": 0, │ "completion_tokens": 204, -│ "prompt_cache_write_tokens": 0, +│ "prompt_cache_creation_tokens": 0, │ "prompt_cached_tokens": 0, │ "prompt_tokens": 133, │ "time_to_first_token": 0, diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v7-auto-hook.span-tree.json b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v7-auto-hook.span-tree.json index b1436df80..92e992742 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v7-auto-hook.span-tree.json +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v7-auto-hook.span-tree.json @@ -69,7 +69,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 0, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 171, "tokens": 171 @@ -137,7 +137,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 0, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 171, "tokens": 171 @@ -201,7 +201,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 0, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 171, "tokens": 171 @@ -299,7 +299,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 0, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 388, "tokens": 388 @@ -359,7 +359,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 0, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 161, "tokens": 161 @@ -2504,7 +2504,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 4, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 13, "time_to_first_token": 0, @@ -2615,7 +2615,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 2, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 21, "time_to_first_token": 0, @@ -2723,7 +2723,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 4, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 13, "time_to_first_token": 0, @@ -2830,7 +2830,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 2, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 21, "time_to_first_token": 0, @@ -2961,7 +2961,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 16, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 19, "time_to_first_token": 0, @@ -3071,7 +3071,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 16, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 20, "time_to_first_token": 0, @@ -3201,7 +3201,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 24, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 46, "time_to_first_token": 0, @@ -3276,7 +3276,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 235, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 133, "time_to_first_token": 0, diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v7-auto-hook.span-tree.txt b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v7-auto-hook.span-tree.txt index 42cd2aa9c..657b62d2c 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v7-auto-hook.span-tree.txt +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v7-auto-hook.span-tree.txt @@ -79,7 +79,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 0, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 171, │ │ "tokens": 171 @@ -139,7 +139,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 0, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 171, │ │ "tokens": 171 @@ -195,7 +195,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 0, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 171, │ │ "tokens": 171 @@ -285,7 +285,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 0, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 388, │ │ "tokens": 388 @@ -337,7 +337,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 0, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 161, │ │ "tokens": 161 @@ -2210,7 +2210,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 4, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 13, │ │ "time_to_first_token": 0, @@ -2313,7 +2313,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 2, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 21, │ │ "time_to_first_token": 0, @@ -2413,7 +2413,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 4, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 13, │ │ "time_to_first_token": 0, @@ -2512,7 +2512,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 2, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 21, │ │ "time_to_first_token": 0, @@ -2627,7 +2627,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 16, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 19, │ │ "time_to_first_token": 0, @@ -2729,7 +2729,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 16, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 20, │ │ "time_to_first_token": 0, @@ -2851,7 +2851,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 24, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 46, │ │ "time_to_first_token": 0, @@ -2918,7 +2918,7 @@ span_tree: │ metrics: { │ "completion_reasoning_tokens": 0, │ "completion_tokens": 235, -│ "prompt_cache_write_tokens": 0, +│ "prompt_cache_creation_tokens": 0, │ "prompt_cached_tokens": 0, │ "prompt_tokens": 133, │ "time_to_first_token": 0, diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v7-latest-auto-hook.span-tree.json b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v7-latest-auto-hook.span-tree.json index 908b1f1f3..dc61b36cd 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v7-latest-auto-hook.span-tree.json +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v7-latest-auto-hook.span-tree.json @@ -69,7 +69,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 0, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 171, "tokens": 171 @@ -137,7 +137,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 0, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 171, "tokens": 171 @@ -201,7 +201,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 0, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 171, "tokens": 171 @@ -299,7 +299,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 0, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 388, "tokens": 388 @@ -359,7 +359,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 0, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 161, "tokens": 161 @@ -2504,7 +2504,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 4, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 13, "time_to_first_token": 0, @@ -2615,7 +2615,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 2, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 21, "time_to_first_token": 0, @@ -2723,7 +2723,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 4, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 13, "time_to_first_token": 0, @@ -2830,7 +2830,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 2, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 21, "time_to_first_token": 0, @@ -2961,7 +2961,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 16, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 19, "time_to_first_token": 0, @@ -3071,7 +3071,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 16, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 20, "time_to_first_token": 0, @@ -3201,7 +3201,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 24, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 46, "time_to_first_token": 0, @@ -3276,7 +3276,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 235, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 133, "time_to_first_token": 0, diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v7-latest-auto-hook.span-tree.txt b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v7-latest-auto-hook.span-tree.txt index 88cace5b9..293c158c1 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v7-latest-auto-hook.span-tree.txt +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v7-latest-auto-hook.span-tree.txt @@ -79,7 +79,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 0, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 171, │ │ "tokens": 171 @@ -139,7 +139,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 0, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 171, │ │ "tokens": 171 @@ -195,7 +195,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 0, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 171, │ │ "tokens": 171 @@ -285,7 +285,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 0, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 388, │ │ "tokens": 388 @@ -337,7 +337,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 0, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 161, │ │ "tokens": 161 @@ -2210,7 +2210,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 4, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 13, │ │ "time_to_first_token": 0, @@ -2313,7 +2313,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 2, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 21, │ │ "time_to_first_token": 0, @@ -2413,7 +2413,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 4, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 13, │ │ "time_to_first_token": 0, @@ -2512,7 +2512,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 2, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 21, │ │ "time_to_first_token": 0, @@ -2627,7 +2627,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 16, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 19, │ │ "time_to_first_token": 0, @@ -2729,7 +2729,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 16, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 20, │ │ "time_to_first_token": 0, @@ -2851,7 +2851,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 24, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 46, │ │ "time_to_first_token": 0, @@ -2918,7 +2918,7 @@ span_tree: │ metrics: { │ "completion_reasoning_tokens": 0, │ "completion_tokens": 235, -│ "prompt_cache_write_tokens": 0, +│ "prompt_cache_creation_tokens": 0, │ "prompt_cached_tokens": 0, │ "prompt_tokens": 133, │ "time_to_first_token": 0, diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v7-latest-wrapped.span-tree.json b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v7-latest-wrapped.span-tree.json index a4d31b799..8f2efee06 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v7-latest-wrapped.span-tree.json +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v7-latest-wrapped.span-tree.json @@ -69,7 +69,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 0, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 171, "tokens": 171 @@ -137,7 +137,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 0, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 171, "tokens": 171 @@ -201,7 +201,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 0, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 171, "tokens": 171 @@ -299,7 +299,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 0, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 388, "tokens": 388 @@ -359,7 +359,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 0, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 161, "tokens": 161 @@ -2496,7 +2496,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 4, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 13, "time_to_first_token": 0, @@ -2607,7 +2607,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 2, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 21, "time_to_first_token": 0, @@ -2715,7 +2715,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 4, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 13, "time_to_first_token": 0, @@ -2822,7 +2822,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 2, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 21, "time_to_first_token": 0, @@ -2953,7 +2953,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 16, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 19, "time_to_first_token": 0, @@ -3063,7 +3063,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 16, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 20, "time_to_first_token": 0, @@ -3201,7 +3201,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 24, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 46, "time_to_first_token": 0, @@ -3276,7 +3276,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 235, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 133, "time_to_first_token": 0, diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v7-latest-wrapped.span-tree.txt b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v7-latest-wrapped.span-tree.txt index 164205f12..797cd4fd8 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v7-latest-wrapped.span-tree.txt +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v7-latest-wrapped.span-tree.txt @@ -79,7 +79,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 0, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 171, │ │ "tokens": 171 @@ -139,7 +139,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 0, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 171, │ │ "tokens": 171 @@ -195,7 +195,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 0, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 171, │ │ "tokens": 171 @@ -285,7 +285,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 0, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 388, │ │ "tokens": 388 @@ -337,7 +337,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 0, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 161, │ │ "tokens": 161 @@ -2202,7 +2202,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 4, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 13, │ │ "time_to_first_token": 0, @@ -2305,7 +2305,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 2, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 21, │ │ "time_to_first_token": 0, @@ -2405,7 +2405,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 4, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 13, │ │ "time_to_first_token": 0, @@ -2504,7 +2504,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 2, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 21, │ │ "time_to_first_token": 0, @@ -2619,7 +2619,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 16, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 19, │ │ "time_to_first_token": 0, @@ -2721,7 +2721,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 16, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 20, │ │ "time_to_first_token": 0, @@ -2851,7 +2851,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 24, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 46, │ │ "time_to_first_token": 0, @@ -2918,7 +2918,7 @@ span_tree: │ metrics: { │ "completion_reasoning_tokens": 0, │ "completion_tokens": 235, -│ "prompt_cache_write_tokens": 0, +│ "prompt_cache_creation_tokens": 0, │ "prompt_cached_tokens": 0, │ "prompt_tokens": 133, │ "time_to_first_token": 0, diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v7-wrapped.span-tree.json b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v7-wrapped.span-tree.json index 16c600b1f..338238180 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v7-wrapped.span-tree.json +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v7-wrapped.span-tree.json @@ -69,7 +69,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 0, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 171, "tokens": 171 @@ -137,7 +137,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 0, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 171, "tokens": 171 @@ -201,7 +201,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 0, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 171, "tokens": 171 @@ -299,7 +299,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 0, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 388, "tokens": 388 @@ -359,7 +359,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 0, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 161, "tokens": 161 @@ -2496,7 +2496,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 4, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 13, "time_to_first_token": 0, @@ -2607,7 +2607,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 2, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 21, "time_to_first_token": 0, @@ -2715,7 +2715,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 4, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 13, "time_to_first_token": 0, @@ -2822,7 +2822,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 2, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 21, "time_to_first_token": 0, @@ -2953,7 +2953,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 16, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 19, "time_to_first_token": 0, @@ -3063,7 +3063,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 16, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 20, "time_to_first_token": 0, @@ -3201,7 +3201,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 24, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 46, "time_to_first_token": 0, @@ -3276,7 +3276,7 @@ "metrics": { "completion_reasoning_tokens": 0, "completion_tokens": 235, - "prompt_cache_write_tokens": 0, + "prompt_cache_creation_tokens": 0, "prompt_cached_tokens": 0, "prompt_tokens": 133, "time_to_first_token": 0, diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v7-wrapped.span-tree.txt b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v7-wrapped.span-tree.txt index 0c31d5f13..c8f144247 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v7-wrapped.span-tree.txt +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v7-wrapped.span-tree.txt @@ -79,7 +79,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 0, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 171, │ │ "tokens": 171 @@ -139,7 +139,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 0, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 171, │ │ "tokens": 171 @@ -195,7 +195,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 0, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 171, │ │ "tokens": 171 @@ -285,7 +285,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 0, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 388, │ │ "tokens": 388 @@ -337,7 +337,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 0, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 161, │ │ "tokens": 161 @@ -2202,7 +2202,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 4, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 13, │ │ "time_to_first_token": 0, @@ -2305,7 +2305,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 2, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 21, │ │ "time_to_first_token": 0, @@ -2405,7 +2405,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 4, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 13, │ │ "time_to_first_token": 0, @@ -2504,7 +2504,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 2, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 21, │ │ "time_to_first_token": 0, @@ -2619,7 +2619,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 16, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 19, │ │ "time_to_first_token": 0, @@ -2721,7 +2721,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 16, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 20, │ │ "time_to_first_token": 0, @@ -2851,7 +2851,7 @@ span_tree: │ │ metrics: { │ │ "completion_reasoning_tokens": 0, │ │ "completion_tokens": 24, -│ │ "prompt_cache_write_tokens": 0, +│ │ "prompt_cache_creation_tokens": 0, │ │ "prompt_cached_tokens": 0, │ │ "prompt_tokens": 46, │ │ "time_to_first_token": 0, @@ -2918,7 +2918,7 @@ span_tree: │ metrics: { │ "completion_reasoning_tokens": 0, │ "completion_tokens": 235, -│ "prompt_cache_write_tokens": 0, +│ "prompt_cache_creation_tokens": 0, │ "prompt_cached_tokens": 0, │ "prompt_tokens": 133, │ "time_to_first_token": 0, diff --git a/js/src/instrumentation/providers/openai-decisions.test.ts b/js/src/instrumentation/providers/openai-decisions.test.ts index 4a1560d4b..789c36b59 100644 --- a/js/src/instrumentation/providers/openai-decisions.test.ts +++ b/js/src/instrumentation/providers/openai-decisions.test.ts @@ -188,7 +188,7 @@ describe("OpenAI decisions", () => { completion_tokens: 0, tokens: 20, prompt_cached_tokens: 10, - prompt_cache_write_tokens: 0, + prompt_cache_creation_tokens: 0, completion_reasoning_tokens: 0, }, }); diff --git a/js/src/instrumentation/providers/openai-instrumentation.test.ts b/js/src/instrumentation/providers/openai-instrumentation.test.ts index 4dbfa3dbe..a69601b94 100644 --- a/js/src/instrumentation/providers/openai-instrumentation.test.ts +++ b/js/src/instrumentation/providers/openai-instrumentation.test.ts @@ -116,6 +116,57 @@ describe("parseMetricsFromUsage", () => { }); }); + it("should parse prompt_tokens_details.cache_write_tokens -> prompt_cache_creation_tokens", () => { + const usage = { + prompt_tokens: 100, + prompt_tokens_details: { + cached_tokens: 10, + cache_write_tokens: 5, + }, + }; + + const result = parseMetricsFromUsage(usage); + + expect(result).toEqual({ + prompt_tokens: 100, + prompt_cached_tokens: 10, + prompt_cache_creation_tokens: 5, + }); + expect(result).not.toHaveProperty("prompt_cache_write_tokens"); + }); + + it("should parse input_tokens_details.cache_write_tokens -> prompt_cache_creation_tokens", () => { + const usage = { + input_tokens: 100, + input_tokens_details: { + cached_tokens: 10, + cache_write_tokens: 3, + }, + }; + + const result = parseMetricsFromUsage(usage); + + expect(result).toEqual({ + prompt_tokens: 100, + prompt_cached_tokens: 10, + prompt_cache_creation_tokens: 3, + }); + expect(result).not.toHaveProperty("prompt_cache_write_tokens"); + }); + + it("should keep an existing prompt_cache_creation_tokens over cache_write_tokens", () => { + const result = parseMetricsFromUsage({ + prompt_tokens: 100, + prompt_cache_creation_tokens: 7, + prompt_tokens_details: { cache_write_tokens: 5 }, + }); + + expect(result).toEqual({ + prompt_tokens: 100, + prompt_cache_creation_tokens: 7, + }); + }); + it("should parse output_tokens_details.reasoning_tokens -> completion_reasoning_tokens", () => { const usage = { output_tokens: 80, diff --git a/js/src/openai-utils.ts b/js/src/openai-utils.ts index 9bc0cfa9c..9953dce03 100644 --- a/js/src/openai-utils.ts +++ b/js/src/openai-utils.ts @@ -60,6 +60,12 @@ export function parseMetricsFromUsage(usage: unknown): Record { } } + const cacheWriteTokens = metrics.prompt_cache_write_tokens; + if (cacheWriteTokens !== undefined) { + delete metrics.prompt_cache_write_tokens; + metrics.prompt_cache_creation_tokens ??= cacheWriteTokens; + } + return metrics; }