tidewave 0.5.2 → 0.5.3
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/CHANGELOG.md +5 -0
- package/README.md +23 -24
- package/dist/cli/index.js +24 -25
- package/dist/next-js/handler.js +1 -1
- package/dist/vite-plugin.js +3 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -135,35 +135,34 @@ directory of the project (or inside `src` folder if using one):
|
|
|
135
135
|
|
|
136
136
|
```typescript
|
|
137
137
|
// instrumentation.ts
|
|
138
|
-
import { NodeSDK } from '@opentelemetry/sdk-node';
|
|
139
138
|
import type { SpanProcessor } from '@opentelemetry/sdk-trace-base';
|
|
140
139
|
import type { LogRecordProcessor } from '@opentelemetry/sdk-logs';
|
|
141
140
|
|
|
142
141
|
export async function register() {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
142
|
+
if (process.env.NEXT_RUNTIME === 'nodejs') {
|
|
143
|
+
const { NodeSDK } = await import('@opentelemetry/sdk-node');
|
|
144
|
+
|
|
145
|
+
// Add your app own processes here existing configuration
|
|
146
|
+
const sdkConfig: {
|
|
147
|
+
spanProcessors: SpanProcessor[];
|
|
148
|
+
logRecordProcessors: LogRecordProcessor[];
|
|
149
|
+
} = {
|
|
150
|
+
spanProcessors: [],
|
|
151
|
+
logRecordProcessors: [],
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
// Conditionally add Tidewave processors in development
|
|
155
|
+
if (process.env.NODE_ENV === 'development') {
|
|
156
|
+
const { TidewaveSpanProcessor, TidewaveLogRecordProcessor } =
|
|
157
|
+
await import('tidewave/next-js/instrumentation');
|
|
158
|
+
|
|
159
|
+
sdkConfig.spanProcessors.push(new TidewaveSpanProcessor());
|
|
160
|
+
sdkConfig.logRecordProcessors.push(new TidewaveLogRecordProcessor());
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
const sdk = new NodeSDK(sdkConfig);
|
|
164
|
+
sdk.start();
|
|
163
165
|
}
|
|
164
|
-
|
|
165
|
-
const sdk = new NodeSDK(sdkConfig);
|
|
166
|
-
sdk.start();
|
|
167
166
|
}
|
|
168
167
|
```
|
|
169
168
|
|
package/dist/cli/index.js
CHANGED
|
@@ -6784,7 +6784,7 @@ var init_src = __esm(() => {
|
|
|
6784
6784
|
});
|
|
6785
6785
|
|
|
6786
6786
|
// package.json
|
|
6787
|
-
var name = "tidewave", version = "0.5.
|
|
6787
|
+
var name = "tidewave", version = "0.5.3", package_default;
|
|
6788
6788
|
var init_package = __esm(() => {
|
|
6789
6789
|
package_default = {
|
|
6790
6790
|
name,
|
|
@@ -17265,36 +17265,35 @@ async function createInstrumentation(dir, dryRun) {
|
|
|
17265
17265
|
printInstrumentationInstructions();
|
|
17266
17266
|
return;
|
|
17267
17267
|
}
|
|
17268
|
-
const instrumentationContent =
|
|
17269
|
-
import {
|
|
17270
|
-
import type { SpanProcessor } from '@opentelemetry/sdk-trace-base';
|
|
17271
|
-
import type { LogRecordProcessor } from '@opentelemetry/sdk-logs';
|
|
17268
|
+
const instrumentationContent = `import type { SpanProcessor } from "@opentelemetry/sdk-trace-base";
|
|
17269
|
+
import type { LogRecordProcessor } from "@opentelemetry/sdk-logs";
|
|
17272
17270
|
|
|
17273
17271
|
export async function register() {
|
|
17274
|
-
|
|
17275
|
-
|
|
17272
|
+
if (process.env.NEXT_RUNTIME === "nodejs") {
|
|
17273
|
+
const { NodeSDK } = await import("@opentelemetry/sdk-node");
|
|
17276
17274
|
|
|
17277
|
-
|
|
17278
|
-
|
|
17279
|
-
|
|
17280
|
-
|
|
17281
|
-
|
|
17282
|
-
|
|
17283
|
-
|
|
17284
|
-
|
|
17275
|
+
// Add your app own processes here existing configuration
|
|
17276
|
+
const sdkConfig: {
|
|
17277
|
+
spanProcessors: SpanProcessor[];
|
|
17278
|
+
logRecordProcessors: LogRecordProcessor[];
|
|
17279
|
+
} = {
|
|
17280
|
+
spanProcessors: [],
|
|
17281
|
+
logRecordProcessors: [],
|
|
17282
|
+
};
|
|
17285
17283
|
|
|
17286
|
-
|
|
17287
|
-
|
|
17288
|
-
|
|
17289
|
-
|
|
17290
|
-
|
|
17284
|
+
// Conditionally add Tidewave processors in development
|
|
17285
|
+
if (process.env.NODE_ENV === "development") {
|
|
17286
|
+
const { TidewaveSpanProcessor, TidewaveLogRecordProcessor } = await import(
|
|
17287
|
+
"tidewave/next-js/instrumentation"
|
|
17288
|
+
);
|
|
17291
17289
|
|
|
17292
|
-
|
|
17293
|
-
|
|
17294
|
-
|
|
17290
|
+
sdkConfig.spanProcessors.push(new TidewaveSpanProcessor());
|
|
17291
|
+
sdkConfig.logRecordProcessors.push(new TidewaveLogRecordProcessor());
|
|
17292
|
+
}
|
|
17295
17293
|
|
|
17296
|
-
|
|
17297
|
-
|
|
17294
|
+
const sdk = new NodeSDK(sdkConfig);
|
|
17295
|
+
sdk.start();
|
|
17296
|
+
}
|
|
17298
17297
|
}
|
|
17299
17298
|
`;
|
|
17300
17299
|
if (dryRun) {
|
package/dist/next-js/handler.js
CHANGED
|
@@ -20137,7 +20137,7 @@ Defaults to 30000 (30 seconds).`),
|
|
|
20137
20137
|
});
|
|
20138
20138
|
|
|
20139
20139
|
// package.json
|
|
20140
|
-
var name = "tidewave", version = "0.5.
|
|
20140
|
+
var name = "tidewave", version = "0.5.3", package_default;
|
|
20141
20141
|
var init_package = __esm(() => {
|
|
20142
20142
|
package_default = {
|
|
20143
20143
|
name,
|
package/dist/vite-plugin.js
CHANGED
|
@@ -20137,7 +20137,7 @@ Defaults to 30000 (30 seconds).`),
|
|
|
20137
20137
|
});
|
|
20138
20138
|
|
|
20139
20139
|
// package.json
|
|
20140
|
-
var name = "tidewave", version = "0.5.
|
|
20140
|
+
var name = "tidewave", version = "0.5.3", package_default;
|
|
20141
20141
|
var init_package = __esm(() => {
|
|
20142
20142
|
package_default = {
|
|
20143
20143
|
name,
|
|
@@ -35014,6 +35014,8 @@ async function tidewaveServer(server, config = DEFAULT_CONFIG) {
|
|
|
35014
35014
|
}
|
|
35015
35015
|
if (typeof host === "string") {
|
|
35016
35016
|
config.host = host;
|
|
35017
|
+
} else if (host === undefined) {
|
|
35018
|
+
config.host = "localhost";
|
|
35017
35019
|
}
|
|
35018
35020
|
if (!(config.host || config.port)) {
|
|
35019
35021
|
console.error(`[Tidewave] should have both host and port configured, got: host: ${host} port: ${port}`);
|