Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,19 @@ jobs:
if: matrix.arch != 'arm64'
run: yarn build:bindings:configure

- name: Remove unsupported Node LTO flags
if: matrix.os == 'windows-2022' && matrix.node == 26 && matrix.arch != 'arm64'
shell: pwsh
run: |
$projectFiles = Get-ChildItem -Path build -Filter *.vcxproj -Recurse
foreach ($file in $projectFiles) {
$content = Get-Content -Raw -Path $file.FullName
$content = $content -replace '(?i)\s*-flto=(thin|full)', ''
$content = $content -replace '(?i)\s*/flto=(thin|full)', ''
$content = $content -replace '(?i)\s*/opt:lldltojobs=\d+', ''
Set-Content -Path $file.FullName -Value $content -NoNewline
}

- name: Configure node-gyp (arm64, ${{ contains(matrix.container, 'alpine') && 'musl' || 'glibc' }})
if: matrix.arch == 'arm64' && matrix.target_platform != 'darwin'
run: yarn build:bindings:configure:arm64
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# `@sentry-internal/node-native-stacktrace`
# `@sentry/node-native-stacktrace`

A native Node.js module that can capture JavaScript stack traces for registered
main or worker threads from any other thread, even if event loops are blocked.
Expand All @@ -22,7 +22,7 @@ feature.
In your main thread or worker threads:

```ts
import { registerThread } from "@sentry-internal/node-native-stacktrace";
import { registerThread } from "@sentry/node-native-stacktrace";

// Register this thread for monitoring
registerThread();
Expand All @@ -31,7 +31,7 @@ registerThread();
### 2. Capture stack traces from any thread

```ts
import { captureStackTrace } from "@sentry-internal/node-native-stacktrace";
import { captureStackTrace } from "@sentry/node-native-stacktrace";

// Capture stack traces from all registered threads
const stacks = captureStackTrace();
Expand Down Expand Up @@ -115,7 +115,7 @@ Send regular heartbeats:
import {
registerThread,
threadPoll,
} from "@sentry-internal/node-native-stacktrace";
} from "@sentry/node-native-stacktrace";
import { AsyncLocalStorage } from "node:async_hooks";

// Create async local storage for state tracking
Expand All @@ -140,7 +140,7 @@ Monitor all registered threads from a dedicated thread:
import {
captureStackTrace,
getThreadsLastSeen,
} from "@sentry-internal/node-native-stacktrace";
} from "@sentry/node-native-stacktrace";

const THRESHOLD = 1000; // 1 second

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@sentry-internal/node-native-stacktrace",
"name": "@sentry/node-native-stacktrace",
"version": "0.5.0",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function getNativeModule(): Native {
return require('../build/Release/stack-trace.node');
} catch (e) {
// eslint-disable-next-line no-console
console.warn('The \'@sentry-internal/node-native-stacktrace\' binary could not be found. Use \'@electron/rebuild\' to ensure the native module is built for Electron.');
console.warn('The \'@sentry/node-native-stacktrace\' binary could not be found. Use \'@electron/rebuild\' to ensure the native module is built for Electron.');
throw e;
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/async-storage.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { AsyncLocalStorage } from 'node:async_hooks';
import { Worker } from 'node:worker_threads';
import { registerThread } from '@sentry-internal/node-native-stacktrace';
import { registerThread } from '@sentry/node-native-stacktrace';
import { longWork } from './long-work.js';

const asyncLocalStorage = new AsyncLocalStorage();
Expand Down
2 changes: 1 addition & 1 deletion test/package.json.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"name": "node-native-stacktrace-test",
"license": "MIT",
"dependencies": {
"@sentry-internal/node-native-stacktrace": "{{path}}"
"@sentry/node-native-stacktrace": "{{path}}"
}
}
2 changes: 1 addition & 1 deletion test/stack-traces.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { Worker } = require('node:worker_threads');
const { longWork } = require('./long-work.js');
const { registerThread } = require('@sentry-internal/node-native-stacktrace');
const { registerThread } = require('@sentry/node-native-stacktrace');

registerThread();

Expand Down
2 changes: 1 addition & 1 deletion test/stalled-disabled.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { Worker } = require('node:worker_threads');
const { AsyncLocalStorage } = require('node:async_hooks');
const { longWork } = require('./long-work.js');
const { registerThread, threadPoll } = require('@sentry-internal/node-native-stacktrace');
const { registerThread, threadPoll } = require('@sentry/node-native-stacktrace');

const asyncLocalStorage = new AsyncLocalStorage();
asyncLocalStorage.enterWith({ some_property: 'some_value' });
Expand Down
2 changes: 1 addition & 1 deletion test/stalled-forever.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { Worker } = require('node:worker_threads');
const { registerThread, threadPoll } = require('@sentry-internal/node-native-stacktrace');
const { registerThread, threadPoll } = require('@sentry/node-native-stacktrace');

registerThread();

Expand Down
2 changes: 1 addition & 1 deletion test/stalled-watchdog.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { captureStackTrace, getThreadsLastSeen } = require('@sentry-internal/node-native-stacktrace');
const { captureStackTrace, getThreadsLastSeen } = require('@sentry/node-native-stacktrace');

const THRESHOLD = 500; // 1 second

Expand Down
2 changes: 1 addition & 1 deletion test/stalled.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { Worker } = require('node:worker_threads');
const { longWork } = require('./long-work.js');
const { registerThread, threadPoll } = require('@sentry-internal/node-native-stacktrace');
const { registerThread, threadPoll } = require('@sentry/node-native-stacktrace');

registerThread();

Expand Down
2 changes: 1 addition & 1 deletion test/watchdog.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { captureStackTrace } = require('@sentry-internal/node-native-stacktrace');
const { captureStackTrace } = require('@sentry/node-native-stacktrace');

setTimeout(() => {
console.log(JSON.stringify(captureStackTrace()));
Expand Down
2 changes: 1 addition & 1 deletion test/worker-do-nothing.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { registerThread, threadPoll } = require('@sentry-internal/node-native-stacktrace');
const { registerThread, threadPoll } = require('@sentry/node-native-stacktrace');

registerThread();

Expand Down
2 changes: 1 addition & 1 deletion test/worker-forever.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { foreverWork } = require('./long-work');
const { registerThread, threadPoll } = require('@sentry-internal/node-native-stacktrace');
const { registerThread, threadPoll } = require('@sentry/node-native-stacktrace');

registerThread();

Expand Down
2 changes: 1 addition & 1 deletion test/worker.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { longWork } = require('./long-work');
const { registerThread } = require('@sentry-internal/node-native-stacktrace');
const { registerThread } = require('@sentry/node-native-stacktrace');

registerThread();

Expand Down
Loading