@interfere/next 12.3.0 → 12.3.1
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
CHANGED
|
@@ -151,16 +151,7 @@ Secret keys that were created for one app keep working. New secret keys belong t
|
|
|
151
151
|
|
|
152
152
|
The standard instrumentation export works on Vercel and other Next.js hosts. In `full` mode, Interfere exports application spans directly. When the build config selects `drain`, the Node SDK initializes `@vercel/otel` with its default processors so Vercel can forward application spans through the configured Trace Drain. Platform spans and application spans remain separate observations.
|
|
153
153
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
```ts
|
|
157
|
-
import { register as registerInterfere } from "@interfere/next/instrumentation";
|
|
158
|
-
|
|
159
|
-
export const register = () => registerInterfere({ serverTracing: "full" });
|
|
160
|
-
export { onRequestError } from "@interfere/next/instrumentation";
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
The explicit option takes precedence over build-injected and environment settings. Edge always exports directly because Vercel does not forward custom Edge spans through Trace Drains. Edge reads the build-injected release identity, falling back to the configured commit SHA.
|
|
154
|
+
The mode and the hosting platform come only from the surface configuration that the build injects. When that configuration reports the Vercel platform (the Surface is linked to a Vercel project), direct trace and log exports are capped at 2 s so a flush cannot hold the invocation open. Edge always exports directly because Vercel does not forward custom Edge spans through Trace Drains. Edge reads the build-injected release identity, falling back to the configured commit SHA.
|
|
164
155
|
|
|
165
156
|
### Composing with an existing Vercel OTel setup
|
|
166
157
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{log}from"../logger.mjs";import{omitUndefined}from"@interfere/helpers/omit-undefined";import{INGEST_URL_GLOBAL}from"@interfere/types/sdk/injected-globals";import{PLUGINS_GLOBAL}from"@interfere/types/sdk/remote-config";import{LOG_SOURCING_GLOBAL}from"@interfere/types/sdk/log-sourcing";import{SERVER_TRACING_GLOBAL}from"@interfere/types/sdk/server-tracing";import{callbackify}from"node:util";import{createBuildConfigResolver}from"@interfere/build/config";let remoteConfigFallbackLogged=!1;const resolveBuildConfig=createBuildConfigResolver(result=>{result.status!==`fallback`||remoteConfigFallbackLogged||(remoteConfigFallbackLogged=!0,log.warn(`Using default SDK settings`,[`Could not load SDK settings from Interfere. The build continues with the default settings.`]))});function valueInjectionLoader(userCode){let options=this.getOptions(),callback=this.async(),values=resolveValues(options);callbackify(async()=>{let globals=await resolveRemoteConfig(resolveFetch(options)).catch(()=>({}));return render({...values,...globals},userCode)})(callback)}function remoteGlobals(config){return omitUndefined({[SERVER_TRACING_GLOBAL]:config.serverTracing,[LOG_SOURCING_GLOBAL]:config.logSourcing,[INGEST_URL_GLOBAL]:config.ingestUrl,[PLUGINS_GLOBAL]:config.plugins})}function render(values,userCode){let lines=Object.entries(values).map(([key,value])=>`globalThis[${JSON.stringify(key)}] = ${JSON.stringify(value)};`);return lines.length===0?userCode:`${lines.join(`
|
|
1
|
+
import{log}from"../logger.mjs";import{omitUndefined}from"@interfere/helpers/omit-undefined";import{INGEST_URL_GLOBAL}from"@interfere/types/sdk/injected-globals";import{PLUGINS_GLOBAL}from"@interfere/types/sdk/remote-config";import{LOG_SOURCING_GLOBAL}from"@interfere/types/sdk/log-sourcing";import{SERVER_TRACING_GLOBAL}from"@interfere/types/sdk/server-tracing";import{callbackify}from"node:util";import{createBuildConfigResolver}from"@interfere/build/config";import{PLATFORM_GLOBAL}from"@interfere/types/integrations/platforms/hosting";let remoteConfigFallbackLogged=!1;const resolveBuildConfig=createBuildConfigResolver(result=>{result.status!==`fallback`||remoteConfigFallbackLogged||(remoteConfigFallbackLogged=!0,log.warn(`Using default SDK settings`,[`Could not load SDK settings from Interfere. The build continues with the default settings.`]))});function valueInjectionLoader(userCode){let options=this.getOptions(),callback=this.async(),values=resolveValues(options);callbackify(async()=>{let globals=await resolveRemoteConfig(resolveFetch(options)).catch(()=>({}));return render({...values,...globals},userCode)})(callback)}function remoteGlobals(config){return omitUndefined({[SERVER_TRACING_GLOBAL]:config.serverTracing,[LOG_SOURCING_GLOBAL]:config.logSourcing,[PLATFORM_GLOBAL]:config.platform,[INGEST_URL_GLOBAL]:config.ingestUrl,[PLUGINS_GLOBAL]:config.plugins})}function render(values,userCode){let lines=Object.entries(values).map(([key,value])=>`globalThis[${JSON.stringify(key)}] = ${JSON.stringify(value)};`);return lines.length===0?userCode:`${lines.join(`
|
|
2
2
|
`)}\n${userCode}`}async function resolveRemoteConfig(fetchOptions){return fetchOptions?resolveBuildConfig(fetchOptions.apiUrl,fetchOptions.publicKey,fetchOptions.cacheScope).then(remoteGlobals):{}}function parseJson(text){if(typeof text==`string`)try{return JSON.parse(text)}catch{return}}function resolveFetch(options){let parsed=parseJson(options.serializedFetch);return isRemoteConfigFetch(parsed)?parsed:null}function isRemoteConfigFetch(value){return isRecord(value)&&typeof value.apiUrl==`string`&&typeof value.publicKey==`string`&&(value.cacheScope===void 0||typeof value.cacheScope==`string`)}function resolveValues(options){let parsed=parseJson(options.serializedValues);return isRecord(parsed)?parsed:{}}function isRecord(value){return typeof value==`object`&&!!value&&!Array.isArray(value)}export{valueInjectionLoader as default};
|
package/dist/package.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var name=`@interfere/next`,version=`12.3.
|
|
1
|
+
var name=`@interfere/next`,version=`12.3.1`;export{name,version};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@interfere/next",
|
|
3
|
-
"version": "12.3.
|
|
3
|
+
"version": "12.3.1",
|
|
4
4
|
"description": "Build software that never breaks.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"error-tracking",
|
|
@@ -97,12 +97,12 @@
|
|
|
97
97
|
"typecheck": "bun check"
|
|
98
98
|
},
|
|
99
99
|
"dependencies": {
|
|
100
|
-
"@interfere/build": "^0.4.
|
|
100
|
+
"@interfere/build": "^0.4.1",
|
|
101
101
|
"@interfere/constants": "^9.3.0",
|
|
102
102
|
"@interfere/helpers": "^9.3.0",
|
|
103
|
-
"@interfere/javascript": "^0.3.
|
|
104
|
-
"@interfere/react": "^12.3.
|
|
105
|
-
"@interfere/types": "^10.5.
|
|
103
|
+
"@interfere/javascript": "^0.3.1",
|
|
104
|
+
"@interfere/react": "^12.3.1",
|
|
105
|
+
"@interfere/types": "^10.5.1",
|
|
106
106
|
"@opentelemetry/api": "1.9.1",
|
|
107
107
|
"@opentelemetry/api-logs": "0.222.0",
|
|
108
108
|
"@opentelemetry/baggage-span-processor": "0.5.0",
|