@stacknext/next 0.11.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +51 -7
- package/docs/configuration.md +1 -1
- package/docs/custom-spans.md +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -11,11 +11,25 @@ npx stacknext dev
|
|
|
11
11
|
|
|
12
12
|
`stacknext init` creates `instrumentation.ts` (or `instrumentation.js` for a
|
|
13
13
|
JavaScript project) only when none exists. Existing instrumentation is never
|
|
14
|
-
overwritten; call `registerStackNext()` from your own
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
overwritten; call `registerStackNext()` from your own `register()` hook instead.
|
|
15
|
+
StackNext yields to an already-registered OpenTelemetry provider rather than
|
|
16
|
+
replacing it.
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
## What it does
|
|
19
|
+
|
|
20
|
+
- registers a `NodeTracerProvider` with a `BatchSpanProcessor` and the StackNext
|
|
21
|
+
exporter;
|
|
22
|
+
- installs a composite W3C propagator so an injected `traceparent` becomes the
|
|
23
|
+
server trace root;
|
|
24
|
+
- forwards `onRequestError` through redaction and normalization;
|
|
25
|
+
- exports documented Next.js spans without patching internals;
|
|
26
|
+
- provides optional manual span and Server Action helpers.
|
|
27
|
+
|
|
28
|
+
`register()` is inert when `STACKNEXT_COLLECTOR_URL` and `STACKNEXT_TOKEN` are
|
|
29
|
+
absent. The package runs only on the Node.js runtime; the Edge export is inert
|
|
30
|
+
so Edge bundling stays safe.
|
|
31
|
+
|
|
32
|
+
## Manual helpers
|
|
19
33
|
|
|
20
34
|
```ts
|
|
21
35
|
import {
|
|
@@ -29,8 +43,38 @@ const digest = withStackNextSpanSync('auth.hash', () => hash(input))
|
|
|
29
43
|
const result = await withStackNextAction('action/save-project', () => save(form))
|
|
30
44
|
```
|
|
31
45
|
|
|
32
|
-
Helpers are no-ops without an active OpenTelemetry provider.
|
|
33
|
-
|
|
34
|
-
|
|
46
|
+
Helpers are no-ops without an active OpenTelemetry provider. They preserve
|
|
47
|
+
return values and errors, sanitize attributes and do not create a second SDK.
|
|
48
|
+
|
|
49
|
+
## Documentation
|
|
50
|
+
|
|
51
|
+
- [Package overview](docs/index.md)
|
|
52
|
+
- [Installation](docs/installation.md)
|
|
53
|
+
- [Instrumentation](docs/instrumentation.md)
|
|
54
|
+
- [Configuration](docs/configuration.md)
|
|
55
|
+
- [Custom spans](docs/custom-spans.md)
|
|
56
|
+
- [Troubleshooting](docs/troubleshooting.md)
|
|
57
|
+
|
|
58
|
+
The `docs/` directory ships in the npm archive. Public guides live on the
|
|
59
|
+
[documentation site](https://github.com/marrrkkk/stacknext/tree/main/apps/docs).
|
|
60
|
+
|
|
61
|
+
## AI agents
|
|
62
|
+
|
|
63
|
+
Agents should read the installed `docs/installation.md` and
|
|
64
|
+
`docs/instrumentation.md` before changing an app's `instrumentation.ts`. Never
|
|
65
|
+
overwrite an existing file; add the StackNext hook to the existing registration.
|
|
66
|
+
See the public
|
|
67
|
+
[Next.js integration guide](https://github.com/marrrkkk/stacknext/blob/main/apps/docs/guides/nextjs.md).
|
|
68
|
+
|
|
69
|
+
## Development
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
pnpm --filter @stacknext/next build
|
|
73
|
+
pnpm --filter @stacknext/next typecheck
|
|
74
|
+
pnpm test
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
The package is ESM-only, supports Next.js 15 and 16 on the Node.js runtime, and
|
|
78
|
+
requires Node.js 20.9 or newer.
|
|
35
79
|
|
|
36
80
|
License: MIT.
|
package/docs/configuration.md
CHANGED
package/docs/custom-spans.md
CHANGED
|
@@ -101,5 +101,5 @@ payloads or secrets in attribute values.
|
|
|
101
101
|
- They do not create a new provider or exporter.
|
|
102
102
|
- They do not capture arguments, return values or bodies.
|
|
103
103
|
|
|
104
|
-
For broader guidance see the repository's `docs/custom-instrumentation.md`
|
|
105
|
-
and `docs/server-actions.md`.
|
|
104
|
+
For broader guidance see the repository's `apps/docs/custom-instrumentation.md`
|
|
105
|
+
and `apps/docs/server-actions.md`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacknext/next",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "Next.js instrumentation and OpenTelemetry exporter for StackNext",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"./package.json": "./package.json"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@stacknext/core": "0.
|
|
27
|
+
"@stacknext/core": "0.12.0",
|
|
28
28
|
"@opentelemetry/api": "1.9.0",
|
|
29
29
|
"@opentelemetry/context-async-hooks": "2.12.0",
|
|
30
30
|
"@opentelemetry/core": "2.12.0",
|