diff --git a/docs/platforms/javascript/common/agent-tracing/mastra.mdx b/docs/platforms/javascript/common/agent-tracing/mastra.mdx index fa1df4e208f10..966ea3b6bc761 100644 --- a/docs/platforms/javascript/common/agent-tracing/mastra.mdx +++ b/docs/platforms/javascript/common/agent-tracing/mastra.mdx @@ -139,7 +139,7 @@ The Sentry exporter captures comprehensive trace data following OpenTelemetry se #### Model Generation Spans - `gen_ai.operation.name`: Operation name (e.g., `chat`) -- `gen_ai.system`: Model provider (e.g., OpenAI, Anthropic) +- `gen_ai.provider.name`: Model provider (e.g., OpenAI, Anthropic) - `gen_ai.request.model`: Model identifier - `gen_ai.request.messages`: Input messages/prompts (JSON) - `gen_ai.response.model`: Response model @@ -158,8 +158,8 @@ The Sentry exporter captures comprehensive trace data following OpenTelemetry se - `gen_ai.tool.name`: Tool identifier - `gen_ai.tool.type`: `function` - `gen_ai.tool.call.id`: Tool call ID -- `gen_ai.tool.input`: Tool input parameters -- `gen_ai.tool.output`: Tool output result +- `gen_ai.tool.call.arguments`: Tool input parameters +- `gen_ai.tool.call.result`: Tool output result - `tool.success`: Success flag #### Agent Run Spans diff --git a/docs/platforms/javascript/common/configuration/integrations/graphql.mdx b/docs/platforms/javascript/common/configuration/integrations/graphql.mdx index 9edaeac99c8ba..53f518ec8e867 100644 --- a/docs/platforms/javascript/common/configuration/integrations/graphql.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/graphql.mdx @@ -68,10 +68,10 @@ When a resolver function is not defined on the schema for a field, GraphQL will _Type: `boolean`_ -By default, this option is `true`. +By default, this option is `true`. When enabled, it records GraphQL operations on the enclosing root span in the `sentry.graphql.operation` attribute. Its effect on the root span name depends on the tracing mode: -With this setting enabled, the GraphQL instrumentation dynamically updates the name of the `http.server` root span by appending -the operation names. Instead of generic span names like `POST /graphql`, span names will be more descriptive, such as `POST /graphql (query MyQuery)`. -For requests containing multiple operations, the span names will aggregate operation names, for example `POST /graphql (query Query1, query Query2)` +- In streaming mode, the root span name stays unchanged. Set the option to `false` to skip adding `sentry.graphql.operation` to the root span. -Set the option to `false` to preserve the default `http.server` span name without this additional context. +- In static mode, with `traceLifecycle: "static"`, enabling this option also appends operation names to the `http.server` root span name. For example, `POST /graphql` becomes `POST /graphql (query MyQuery)`. Requests containing multiple operations include each operation name, such as `POST /graphql (query Query1, query Query2)`. Set the option to `false` to skip the root span attribute and preserve the original root span name. + +In both modes, the GraphQL span records `graphql.operation.name` and `graphql.operation.type` when available, regardless of this option. diff --git a/docs/platforms/javascript/common/configuration/integrations/supabase.mdx b/docs/platforms/javascript/common/configuration/integrations/supabase.mdx index 1531e7a70c7dc..4b27965cfb57a 100644 --- a/docs/platforms/javascript/common/configuration/integrations/supabase.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/supabase.mdx @@ -91,7 +91,7 @@ These spans are used to populate Sentry's [pre-built Query Dashboards](/product/ - `db.schema`: The database schema - `db.url`: The Supabase instance URL - `db.sdk`: Client information -- `db.system`: Set to 'postgresql' +- `db.system.name`: Set to 'postgresql' - `db.query`: The query parameters - `db.body`: The request body (for mutations) diff --git a/docs/platforms/javascript/common/tracing/instrumentation/index.mdx b/docs/platforms/javascript/common/tracing/instrumentation/index.mdx index 3bb8112b3e6ed..b3dd3186db461 100644 --- a/docs/platforms/javascript/common/tracing/instrumentation/index.mdx +++ b/docs/platforms/javascript/common/tracing/instrumentation/index.mdx @@ -256,12 +256,9 @@ if (span) { } ``` -Prior to v8.39.0, you had to use `span.updateName('New Name')`, which had some limitations in `@sentry/node` and SDKs depending on it (for example, `@sentry/nextjs`): +Automatically instrumented spans use attributes such as `http.request.method` and `db.system.name` to derive their names. These names are low-cardinality. Raw URL paths, full query statements, and other request-specific details stay in attributes instead of the span name. -- Spans with `http.method` or `http.request.method` attributes would automatically have their name set to the method + the URL path. -- Spans with `db.system` attributes would automatically have their name set to the system + the statement. - -Using `Sentry.updateSpanName()` ensures that the name is updated correctly and no longer overwritten in these cases. +Use `Sentry.updateSpanName()` to override the automatically generated name. Choose a name that groups similar operations, and store request-specific details in span attributes. If you use `@sentry/browser`, `@sentry/react`, and so on in browser environments, `span.updateName()` and `Sentry.updateSpanName()` will function identically, so you can use either one of them. diff --git a/docs/platforms/javascript/common/tracing/instrumentation/requests-module.mdx b/docs/platforms/javascript/common/tracing/instrumentation/requests-module.mdx index 4701c5aaf7a77..1edce4069f9df 100644 --- a/docs/platforms/javascript/common/tracing/instrumentation/requests-module.mdx +++ b/docs/platforms/javascript/common/tracing/instrumentation/requests-module.mdx @@ -36,7 +36,7 @@ async function makeRequest(method, url) { span.setAttribute("http.response.status_code", response.status); span.setAttribute( - "http.response_content_length", + "http.response.body.size", Number(response.headers.get("content-length")) ); diff --git a/platform-includes/performance/add-spans-example/javascript.mdx b/platform-includes/performance/add-spans-example/javascript.mdx index 4092a0bf335c7..800967ac2397f 100644 --- a/platform-includes/performance/add-spans-example/javascript.mdx +++ b/platform-includes/performance/add-spans-example/javascript.mdx @@ -45,7 +45,7 @@ function processItem(item) { http.get(`/items/${item.id}`, (response) => { response.on("data", () => {}); response.on("end", () => { - span.setTag("http.status_code", response.statusCode); + span.setAttribute("http.response.status_code", response.statusCode); span.setAttribute( "http.foobarsessionid", getFoobarSessionid(response) @@ -72,7 +72,7 @@ function processItem(item) { const response = await fetch("/items/${item.id}"); const json = await response.json(); - span.setTag("http.status_code", response.statusCode); + span.setAttribute("http.response.status_code", response.status); span.setAttribute("http.foobarsessionid", getFoobarSessionid(response)); } ); diff --git a/platform-includes/performance/automatic-instrumentation-custom-routing/javascript.mdx b/platform-includes/performance/automatic-instrumentation-custom-routing/javascript.mdx index f1238fabd3b94..5e4738e8946de 100644 --- a/platform-includes/performance/automatic-instrumentation-custom-routing/javascript.mdx +++ b/platform-includes/performance/automatic-instrumentation-custom-routing/javascript.mdx @@ -19,7 +19,7 @@ const client = Sentry.init({ let pageLoadSpan = Sentry.startBrowserTracingPageLoadSpan(client, { name: window.location.pathname, attributes: { - [Sentry.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: "url", + [Sentry.SENTRY_SEGMENT_NAME_SOURCE]: "url", }, }); @@ -29,14 +29,14 @@ myRouter.on("routeChange", (route) => { // After that, each route change should trigger a navigation span (which will automatically finish the previous one) if (pageLoadSpan) { pageLoadSpan.updateName(route.name); - pageLoadSpan.setAttribute(Sentry.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, "route"); + pageLoadSpan.setAttribute(Sentry.SENTRY_SEGMENT_NAME_SOURCE, "route"); pageLoadSpan = undefined; } else { Sentry.startBrowserTracingNavigationSpan(client, { op: "navigation", name: route.name, // or what the name of the span should be attributes: { - [Sentry.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: "route", + [Sentry.SENTRY_SEGMENT_NAME_SOURCE]: "route", }, }); }