Skip to content

Commit dac5b71

Browse files
fix(server-utils): Drop dead embeddings name branch and unused fallback docs
Embeddings always use operation embeddings, so the unknown-operation fallback was unreachable. Docs now match that the convention fallback is unused today. Co-Authored-By: Cursor Grok 4.6 <cursoragent@cursor.com>
1 parent 6044722 commit dac5b71

3 files changed

Lines changed: 12 additions & 16 deletions

File tree

MIGRATION.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -621,11 +621,11 @@ If you [opt out of span streaming](#opting-out-of-span-streaming), span names re
621621

622622
The following span names were adjusted:
623623

624-
| Span op | Before | After |
625-
| ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
626-
| `pageload` | The parameterized route, or the raw URL path if the SDK couldn't resolve one (`/users/123`) | The parameterized route, or `Pageload` if the SDK has none |
627-
| `gen_ai.chat`, `gen_ai.embeddings`, `gen_ai.generate_content`, … | `{operation} {model}`, or `{operation} unknown` if the model is missing (`chat unknown`) | `{operation} {model}`, or `{operation}` if the model is missing, or `Generative AI model operation` if the SDK has none |
628-
| `gen_ai.execute_tool` | `execute_tool {tool name}` (`execute_tool getWeather`) | `execute_tool`; the tool name stays on `gen_ai.tool.name` |
624+
| Span op | Before | After |
625+
| ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
626+
| `pageload` | The parameterized route, or the raw URL path if the SDK couldn't resolve one (`/users/123`) | The parameterized route, or `Pageload` if the SDK has none |
627+
| `gen_ai.chat`, `gen_ai.embeddings`, `gen_ai.generate_content`, … | `{operation} {model}`, or `{operation} unknown` if the model is missing (`chat unknown`) | `{operation} {model}`, or `{operation}` if the model is missing (`chat`). Instrumented methods always have an operation, so the convention fallback `Generative AI model operation` is unused today. |
628+
| `gen_ai.execute_tool` | `execute_tool {tool name}` (`execute_tool getWeather`) | `execute_tool`; the tool name stays on `gen_ai.tool.name` |
629629

630630
Resolved low-cardinality values are kept in both lifecycles: a known model stays in the name (`chat gpt-4`).
631631

docs/migration/v11-end-state.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -481,11 +481,11 @@ Affected SDKs: All SDKs.
481481
482482
With [span streaming](#span-streaming-is-now-the-default) enabled (the default), span names are now **low cardinality**, following the [Sentry span name conventions](https://getsentry.github.io/sentry-conventions/names/). If you [opt out of span streaming](#opting-out-of-span-streaming), span names remain unchanged.
483483
484-
| Span op | Before | After |
485-
| ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
486-
| `pageload` | The parameterized route, or the raw URL path if the SDK couldn't resolve one (`/users/123`) | The parameterized route, or `Pageload` if the SDK has none |
487-
| `gen_ai.chat`, `gen_ai.embeddings`, `gen_ai.generate_content`, … | `{operation} {model}`, or `{operation} unknown` if the model is missing (`chat unknown`) | `{operation} {model}`, or `{operation}` if the model is missing, or `Generative AI model operation` if the SDK has none |
488-
| `gen_ai.execute_tool` | `execute_tool {tool name}` (`execute_tool getWeather`) | `execute_tool`; the tool name stays on `gen_ai.tool.name` |
484+
| Span op | Before | After |
485+
| ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
486+
| `pageload` | The parameterized route, or the raw URL path if the SDK couldn't resolve one (`/users/123`) | The parameterized route, or `Pageload` if the SDK has none |
487+
| `gen_ai.chat`, `gen_ai.embeddings`, `gen_ai.generate_content`, … | `{operation} {model}`, or `{operation} unknown` if the model is missing (`chat unknown`) | `{operation} {model}`, or `{operation}` if the model is missing (`chat`). Instrumented methods always have an operation, so the convention fallback `Generative AI model operation` is unused today. |
488+
| `gen_ai.execute_tool` | `execute_tool {tool name}` (`execute_tool getWeather`) | `execute_tool`; the tool name stays on `gen_ai.tool.name` |
489489
490490
Resolved low-cardinality values are kept in both lifecycles: a known model stays in the name (`chat gpt-4`).
491491

packages/server-utils/src/ai/langchain/embeddings.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import {
22
captureException,
3-
GEN_AI_INFERENCE_SPAN_NAME_FALLBACK,
43
getClient,
54
hasSpanStreamingEnabled,
65
SEMANTIC_ATTRIBUTE_SENTRY_OP,
@@ -78,7 +77,6 @@ export function _INTERNAL_getLangChainEmbeddingsSpanOptions(
7877
const { recordInputs } = resolveAIRecordingOptions(options);
7978
const attributes = extractEmbeddingAttributes(instance);
8079
const modelName = attributes[GEN_AI_REQUEST_MODEL] || 'unknown';
81-
const operationName: string = 'embeddings';
8280
const client = getClient();
8381

8482
if (recordInputs && input != null) {
@@ -89,10 +87,8 @@ export function _INTERNAL_getLangChainEmbeddingsSpanOptions(
8987
// With span streaming, omit the `'unknown'` model sentinel so the name stays low-cardinality.
9088
name:
9189
(typeof modelName === 'string' && modelName !== 'unknown') || !(client && hasSpanStreamingEnabled(client))
92-
? `${operationName} ${modelName}`
93-
: operationName !== 'unknown'
94-
? operationName
95-
: GEN_AI_INFERENCE_SPAN_NAME_FALLBACK,
90+
? `embeddings ${modelName}`
91+
: 'embeddings',
9692
op: GEN_AI_EMBEDDINGS_OPERATION_ATTRIBUTE,
9793
attributes: attributes as Record<string, SpanAttributeValue>,
9894
};

0 commit comments

Comments
 (0)