Skip to content

Commit bdc2324

Browse files
committed
Merge remote-tracking branch 'origin/develop' into nh/unify-request-attribute-extraction
# Conflicts: # packages/core/src/tracing/ai/utils.ts # packages/core/src/tracing/anthropic-ai/index.ts # packages/core/src/tracing/google-genai/index.ts # packages/core/src/tracing/openai/index.ts # packages/core/src/tracing/openai/streaming.ts # packages/core/src/tracing/openai/utils.ts
2 parents 53a11fc + 4be2e67 commit bdc2324

284 files changed

Lines changed: 9838 additions & 2185 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ jobs:
130130
run: yarn build
131131

132132
- name: Upload build artifacts
133-
uses: actions/upload-artifact@v6
133+
uses: actions/upload-artifact@v7
134134
with:
135135
name: build-output
136136
path: ${{ env.CACHED_BUILD_PATHS }}
@@ -174,7 +174,7 @@ jobs:
174174
pull-requests: write
175175
steps:
176176
- name: PR is opened against master
177-
uses: mshick/add-pr-comment@dd126dd8c253650d181ad9538d8b4fa218fc31e8
177+
uses: mshick/add-pr-comment@e7516d74559b5514092f5b096ed29a629a1237c6
178178
if: ${{ github.base_ref == 'master' && !startsWith(github.head_ref, 'prepare-release/') }}
179179
with:
180180
message: |
@@ -351,7 +351,7 @@ jobs:
351351
run: yarn build:tarball
352352

353353
- name: Archive artifacts
354-
uses: actions/upload-artifact@v6
354+
uses: actions/upload-artifact@v7
355355
with:
356356
name: ${{ github.sha }}
357357
retention-days: 90
@@ -588,7 +588,7 @@ jobs:
588588
format(' --shard={0}/{1}', matrix.shard, matrix.shards) || '' }}
589589

590590
- name: Upload Playwright Traces
591-
uses: actions/upload-artifact@v6
591+
uses: actions/upload-artifact@v7
592592
if: failure()
593593
with:
594594
name:
@@ -654,7 +654,7 @@ jobs:
654654
yarn test:loader
655655
656656
- name: Upload Playwright Traces
657-
uses: actions/upload-artifact@v6
657+
uses: actions/upload-artifact@v7
658658
if: failure()
659659
with:
660660
name: playwright-traces-job_browser_loader_tests-${{ matrix.bundle}}
@@ -1030,7 +1030,7 @@ jobs:
10301030
SENTRY_E2E_WORKSPACE_ROOT: ${{ github.workspace }}
10311031

10321032
- name: Upload Playwright Traces
1033-
uses: actions/upload-artifact@v6
1033+
uses: actions/upload-artifact@v7
10341034
if: failure()
10351035
with:
10361036
name: playwright-traces-job_e2e_playwright_tests-${{ matrix.test-application}}
@@ -1044,7 +1044,7 @@ jobs:
10441044
node ./scripts/normalize-e2e-test-dump-transaction-events.js
10451045
10461046
- name: Upload E2E Test Event Dumps
1047-
uses: actions/upload-artifact@v6
1047+
uses: actions/upload-artifact@v7
10481048
if: failure()
10491049
with:
10501050
name: E2E Test Dump (${{ matrix.label || matrix.test-application }})
@@ -1157,7 +1157,7 @@ jobs:
11571157
node ./scripts/normalize-e2e-test-dump-transaction-events.js
11581158
11591159
- name: Upload E2E Test Event Dumps
1160-
uses: actions/upload-artifact@v6
1160+
uses: actions/upload-artifact@v7
11611161
if: failure()
11621162
with:
11631163
name: E2E Test Dump (${{ matrix.label || matrix.test-application }})

.github/workflows/changelog-preview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ permissions:
1515

1616
jobs:
1717
changelog-preview:
18-
uses: getsentry/craft/.github/workflows/changelog-preview.yml@2.24.1
18+
uses: getsentry/craft/.github/workflows/changelog-preview.yml@2.25.2
1919
secrets: inherit

.github/workflows/create-issue-for-unreferenced-prs.yml

Lines changed: 0 additions & 130 deletions
This file was deleted.

.github/workflows/flaky-test-detector.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
TEST_RUN_COUNT: 'AUTO'
7272

7373
- name: Upload Playwright Traces
74-
uses: actions/upload-artifact@v6
74+
uses: actions/upload-artifact@v7
7575
if: failure() && steps.test.outcome == 'failure'
7676
with:
7777
name: playwright-test-results

.github/workflows/validate-pr.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Validate PR
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, reopened]
6+
7+
jobs:
8+
validate-pr:
9+
runs-on: ubuntu-24.04
10+
permissions:
11+
pull-requests: write
12+
steps:
13+
- uses: getsentry/github-workflows/validate-pr@71588ddf95134f804e82c5970a8098588e2eaecd
14+
with:
15+
app-id: ${{ vars.SDK_MAINTAINER_BOT_APP_ID }}
16+
private-key: ${{ secrets.SDK_MAINTAINER_BOT_PRIVATE_KEY }}

.version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"_comment": "Auto-generated by scripts/bump-version.js. Used by the gitflow sync workflow to detect version bumps. Do not edit manually.",
3-
"version": "10.46.0"
3+
"version": "10.47.0"
44
}

CHANGELOG.md

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,153 @@
44

55
- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott
66

7+
- **ref(core): Unify .do\* span ops to `gen_ai.generate_content` ([#20074](https://github.com/getsentry/sentry-javascript/pull/20074))**
8+
9+
All Vercel AI `do*` spans (`ai.generateText.doGenerate`, `ai.streamText.doStream`, `ai.generateObject.doGenerate`, `ai.streamObject.doStream`) now use a single unified span op `gen_ai.generate_content` instead of separate ops like `gen_ai.generate_text`, `gen_ai.stream_text`, `gen_ai.generate_object`, and `gen_ai.stream_object`.
10+
11+
- **ref(core): Remove provider-specific AI span attributes in favor of `gen_ai` attributes in sentry conventions ([#20011](https://github.com/getsentry/sentry-javascript/pull/20011))**
12+
13+
The following provider-specific span attributes have been removed from the OpenAI and Anthropic AI integrations. Use the standardized `gen_ai.*` equivalents instead:
14+
15+
| Removed attribute | Replacement |
16+
| -------------------------------- | ---------------------------- |
17+
| `openai.response.id` | `gen_ai.response.id` |
18+
| `openai.response.model` | `gen_ai.response.model` |
19+
| `openai.usage.prompt_tokens` | `gen_ai.usage.input_tokens` |
20+
| `openai.usage.completion_tokens` | `gen_ai.usage.output_tokens` |
21+
| `openai.response.timestamp` | _(removed, no replacement)_ |
22+
| `anthropic.response.timestamp` | _(removed, no replacement)_ |
23+
24+
If you reference these attributes in hooks (e.g. `beforeSendTransaction`), update them to the `gen_ai.*` equivalents.
25+
26+
- feat(langchain): Support embeddings APIs in LangChain ([#20017](https://github.com/getsentry/sentry-javascript/pull/20017))
27+
28+
Adds instrumentation for LangChain embeddings (`embedQuery`, `embedDocuments`), creating `gen_ai.embeddings` spans. In Node.js, embedding classes from `@langchain/openai`, `@langchain/google-genai`, `@langchain/mistralai`, and `@langchain/google-vertexai` are auto-instrumented. For other runtimes, use the new `instrumentLangChainEmbeddings` API:
29+
30+
```javascript
31+
import * as Sentry from '@sentry/cloudflare';
32+
import { OpenAIEmbeddings } from '@langchain/openai';
33+
34+
const embeddings = Sentry.instrumentLangChainEmbeddings(new OpenAIEmbeddings({ model: 'text-embedding-3-small' }));
35+
36+
await embeddings.embedQuery('Hello world');
37+
```
38+
39+
## 10.47.0
40+
41+
### Important Changes
42+
43+
- **feat(node-core): Add OTLP integration for node-core/light ([#19729](https://github.com/getsentry/sentry-javascript/pull/19729))**
44+
45+
Added `otlpIntegration` at `@sentry/node-core/light/otlp` for users who manage
46+
their own OpenTelemetry setup and want to send trace data to Sentry without
47+
adopting the full `@sentry/node` SDK.
48+
49+
```js
50+
import { NodeTracerProvider } from '@opentelemetry/sdk-trace-node';
51+
import * as Sentry from '@sentry/node-core/light';
52+
import { otlpIntegration } from '@sentry/node-core/light/otlp';
53+
54+
const provider = new NodeTracerProvider();
55+
provider.register();
56+
57+
Sentry.init({
58+
dsn: '__DSN__',
59+
integrations: [
60+
otlpIntegration({
61+
// Export OTel spans to Sentry via OTLP (default: true)
62+
setupOtlpTracesExporter: true,
63+
}),
64+
],
65+
});
66+
```
67+
68+
The integration links Sentry errors to OTel traces and exports spans to Sentry via OTLP.
69+
70+
- **feat(node, bun): Add runtime metrics integrations for Node.js and Bun ([#19923](https://github.com/getsentry/sentry-javascript/pull/19923), [#19979](https://github.com/getsentry/sentry-javascript/pull/19979))**
71+
72+
New `nodeRuntimeMetricsIntegration` and `bunRuntimeMetricsIntegration` automatically collect runtime health metrics and send them to Sentry on a configurable interval (default: 30s). Collected metrics include memory (RSS, heap used/total), CPU utilization, event loop utilization, and process uptime. Node additionally collects event loop delay percentiles (p50, p99). Extra metrics like CPU time and external memory are available as opt-in.
73+
74+
```ts
75+
// Node.js
76+
import * as Sentry from '@sentry/node';
77+
78+
Sentry.init({
79+
dsn: '...',
80+
integrations: [Sentry.nodeRuntimeMetricsIntegration()],
81+
});
82+
83+
// Bun
84+
import * as Sentry from '@sentry/bun';
85+
86+
Sentry.init({
87+
dsn: '...',
88+
integrations: [Sentry.bunRuntimeMetricsIntegration()],
89+
});
90+
```
91+
92+
- **feat(core): Support embedding APIs in google-genai ([#19797](https://github.com/getsentry/sentry-javascript/pull/19797))**
93+
94+
Adds instrumentation for the Google GenAI [`embedContent`](https://ai.google.dev/gemini-api/docs/embeddings) API, creating `gen_ai.embeddings` spans.
95+
96+
- **feat(browser): Add `elementTimingIntegration` for tracking element render and load times ([#19869](https://github.com/getsentry/sentry-javascript/pull/19869))**
97+
98+
The new `elementTimingIntegration` captures Element Timing API data as Sentry metrics. It emits `element_timing.render_time` and `element_timing.load_time` distribution metrics for elements annotated with the `elementtiming` HTML attribute.
99+
100+
```ts
101+
import * as Sentry from '@sentry/browser';
102+
103+
Sentry.init({
104+
dsn: '__DSN__',
105+
integrations: [Sentry.browserTracingIntegration(), Sentry.elementTimingIntegration()],
106+
});
107+
```
108+
109+
```html
110+
<img src="hero.jpg" elementtiming="hero-image" />
111+
```
112+
113+
### Other Changes
114+
115+
- feat(nuxt): Add middleware instrumentation compatibility for Nuxt 5 ([#19968](https://github.com/getsentry/sentry-javascript/pull/19968))
116+
- feat(nuxt): Support parametrized SSR routes in Nuxt 5 ([#19977](https://github.com/getsentry/sentry-javascript/pull/19977))
117+
- feat(solid): Add route parametrization for Solid Router ([#20031](https://github.com/getsentry/sentry-javascript/pull/20031))
118+
- fix(core): Guard nullish response in supabase PostgREST handler ([#20033](https://github.com/getsentry/sentry-javascript/pull/20033))
119+
- fix(node): Deduplicate `sentry-trace` and `baggage` headers on outgoing requests ([#19960](https://github.com/getsentry/sentry-javascript/pull/19960))
120+
- fix(node): Ensure startNewTrace propagates traceId in OTel environments ([#19963](https://github.com/getsentry/sentry-javascript/pull/19963))
121+
- fix(nuxt): Use virtual module for Nuxt pages data (SSR route parametrization) ([#20020](https://github.com/getsentry/sentry-javascript/pull/20020))
122+
- fix(opentelemetry): Convert seconds timestamps in span.end() to milliseconds ([#19958](https://github.com/getsentry/sentry-javascript/pull/19958))
123+
- fix(profiling): Disable profiling in worker threads ([#20040](https://github.com/getsentry/sentry-javascript/pull/20040))
124+
- fix(react-router): Disable debug ID injection in Vite plugin to prevent double injection ([#19890](https://github.com/getsentry/sentry-javascript/pull/19890))
125+
- refactor(browser): Reduce browser package bundle size ([#19856](https://github.com/getsentry/sentry-javascript/pull/19856))
126+
- feat(deps): Bump OpenTelemetry dependencies ([#20046](https://github.com/getsentry/sentry-javascript/pull/20046))
127+
128+
<details>
129+
<summary> <strong>Internal Changes</strong> </summary>
130+
131+
- chore: Add shared validate-pr composite action ([#20025](https://github.com/getsentry/sentry-javascript/pull/20025))
132+
- chore: Update validate-pr action to latest version ([#20027](https://github.com/getsentry/sentry-javascript/pull/20027))
133+
- chore(deps): Bump @apollo/server from 5.4.0 to 5.5.0 ([#20007](https://github.com/getsentry/sentry-javascript/pull/20007))
134+
- chore(deps): Bump amqplib from 0.10.7 to 0.10.9 ([#20000](https://github.com/getsentry/sentry-javascript/pull/20000))
135+
- chore(deps): Bump srvx from 0.11.12 to 0.11.13 ([#20001](https://github.com/getsentry/sentry-javascript/pull/20001))
136+
- chore(deps-dev): Bump node-forge from 1.3.2 to 1.4.0 ([#20012](https://github.com/getsentry/sentry-javascript/pull/20012))
137+
- chore(deps-dev): Bump yaml from 2.8.2 to 2.8.3 ([#19985](https://github.com/getsentry/sentry-javascript/pull/19985))
138+
- ci(deps): Bump actions/upload-artifact from 6 to 7 ([#19569](https://github.com/getsentry/sentry-javascript/pull/19569))
139+
- docs(release): Update publishing-a-release.md ([#19982](https://github.com/getsentry/sentry-javascript/pull/19982))
140+
- feat(deps): Bump babel-loader from 10.0.0 to 10.1.1 ([#19997](https://github.com/getsentry/sentry-javascript/pull/19997))
141+
- feat(deps): Bump handlebars from 4.7.7 to 4.7.9 ([#20008](https://github.com/getsentry/sentry-javascript/pull/20008))
142+
- fix(browser-tests): Pin axios to 1.13.5 to avoid compromised 1.14.1 ([#20047](https://github.com/getsentry/sentry-javascript/pull/20047))
143+
- fix(ci): Update validate-pr action to remove draft enforcement ([#20035](https://github.com/getsentry/sentry-javascript/pull/20035))
144+
- fix(ci): Update validate-pr action to remove draft enforcement ([#20037](https://github.com/getsentry/sentry-javascript/pull/20037))
145+
- fix(e2e): Pin @opentelemetry/api to 1.9.0 in ts3.8 test app ([#19992](https://github.com/getsentry/sentry-javascript/pull/19992))
146+
- ref(browser-tests): Add waitForMetricRequest helper ([#20002](https://github.com/getsentry/sentry-javascript/pull/20002))
147+
- ref(core): Consolidate getOperationName into one shared utility ([#19971](https://github.com/getsentry/sentry-javascript/pull/19971))
148+
- ref(core): Introduce instrumented method registry for AI integrations ([#19981](https://github.com/getsentry/sentry-javascript/pull/19981))
149+
- test(deno): Expand Deno E2E test coverage ([#19957](https://github.com/getsentry/sentry-javascript/pull/19957))
150+
- test(e2e): Add e2e tests for `nodeRuntimeMetricsIntegration` ([#19989](https://github.com/getsentry/sentry-javascript/pull/19989))
151+
152+
</details>
153+
7154
## 10.46.0
8155

9156
### Important Changes

0 commit comments

Comments
 (0)