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
2 changes: 1 addition & 1 deletion docs/nextjs-initialization.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Next.js Initialization
# Next.js Initialization (Beta)

This guide explains how to set up Tusk Drift in your Next.js application.

Expand Down
7 changes: 5 additions & 2 deletions src/core/tracing/JsonSchemaHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export class JsonSchemaHelper {

/**
* Generate schema from data object using standardized types
*
*
* Note: We properties always exists on JsonSchema because proto3 maps cannot be marked optional.
* The JSON data is a bit inefficient because of this, but the easiest way to handle this is to keep it for now.
*/
Expand All @@ -188,7 +188,10 @@ export class JsonSchemaHelper {
if (Array.isArray(data) && data.length === 0) {
return { type: JsonSchemaType.ORDERED_LIST, properties: {} };
}
const items = Array.isArray(data) && data.length > 0 ? JsonSchemaHelper.generateSchema(data[0]) : undefined;
const items =
Array.isArray(data) && data.length > 0
? JsonSchemaHelper.generateSchema(data[0])
: undefined;
if (items !== undefined) {
return {
type: JsonSchemaType.ORDERED_LIST,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ COPY src/instrumentation/libraries/fetch/e2e-tests/cjs-fetch/tsconfig.json ./
# Install dependencies
RUN npm install

# Add cache-busting argument to force fresh CLI download
ARG CACHEBUST=1
# Install Tusk Drift CLI
RUN curl -fsSL https://raw.githubusercontent.com/Use-Tusk/tusk-drift-cli/main/install.sh | sh

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ COPY src/instrumentation/libraries/fetch/e2e-tests/esm-fetch/tsconfig.json ./
# Install dependencies
RUN npm install

# Add cache-busting argument to force fresh CLI download
ARG CACHEBUST=1
# Install Tusk Drift CLI
RUN curl -fsSL https://raw.githubusercontent.com/Use-Tusk/tusk-drift-cli/main/install.sh | sh

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ COPY src/instrumentation/libraries/grpc/e2e-tests/cjs-grpc/tsconfig.json ./
# Install dependencies
RUN npm install

# Add cache-busting argument to force fresh CLI download
ARG CACHEBUST=1
# Install Tusk Drift CLI
RUN curl -fsSL https://raw.githubusercontent.com/Use-Tusk/tusk-drift-cli/main/install.sh | sh

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ COPY src/instrumentation/libraries/grpc/e2e-tests/esm-grpc/tsconfig.json ./
# Install dependencies
RUN npm install

# Add cache-busting argument to force fresh CLI download
ARG CACHEBUST=1
# Install Tusk Drift CLI
RUN curl -fsSL https://raw.githubusercontent.com/Use-Tusk/tusk-drift-cli/main/install.sh | sh

Expand Down
6 changes: 4 additions & 2 deletions src/instrumentation/libraries/http/Instrumentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export class HttpInstrumentation extends TdInstrumentationBase {
}

// ESM Support: Detect if this is an ESM module
const isESM = (httpModule as any)[Symbol.toStringTag] === 'Module';
const isESM = (httpModule as any)[Symbol.toStringTag] === "Module";

if (isESM) {
// ESM Case: Also set wrapped methods on the default export
Expand Down Expand Up @@ -181,6 +181,8 @@ export class HttpInstrumentation extends TdInstrumentationBase {
return originalHandler.call(this);
}

logger.debug(`[HttpInstrumentation] Setting replay trace id`, replayTraceId);

// Set env vars for current trace
const envVars = this.replayHooks.extractEnvVarsFromHeaders(req);
if (envVars) {
Expand Down Expand Up @@ -933,7 +935,7 @@ export class HttpInstrumentation extends TdInstrumentationBase {
complete: true,
readable: false,
// Add error-specific fields
errorName: error.name || 'UNKNOWN',
errorName: error.name || "UNKNOWN",
errorMessage: error.message,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ COPY src/instrumentation/libraries/http/e2e-tests/cjs-http/tsconfig.json ./
# Install dependencies
RUN npm install

# Add cache-busting argument to force fresh CLI download
ARG CACHEBUST=1
# Install Tusk Drift CLI
RUN curl -fsSL https://raw.githubusercontent.com/Use-Tusk/tusk-drift-cli/main/install.sh | sh

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ COPY src/instrumentation/libraries/http/e2e-tests/esm-http/tsconfig.json ./
# Install dependencies
RUN npm install

# Add cache-busting argument to force fresh CLI download
ARG CACHEBUST=1
# Install Tusk Drift CLI
RUN curl -fsSL https://raw.githubusercontent.com/Use-Tusk/tusk-drift-cli/main/install.sh | sh

Expand Down
11 changes: 6 additions & 5 deletions src/instrumentation/libraries/ioredis/Instrumentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ import {
IORedisOutputValue,
BufferMetadata,
} from "./types";
import {
convertValueToJsonable,
} from "./utils";
import { convertValueToJsonable } from "./utils";
import { PackageType } from "@use-tusk/drift-schemas/core/span";
import { logger } from "../../../core/utils/logger";

Expand Down Expand Up @@ -125,7 +123,7 @@ export class IORedisInstrumentation extends TdInstrumentationBase {
const actualExports = isESM ? moduleExports.default : moduleExports;

if (!actualExports || !actualExports.prototype) {
logger.error(`[IORedisInstrumentation] Invalid Pipeline module exports, cannot patch`);
logger.debug(`[IORedisInstrumentation] Invalid Pipeline module exports, cannot patch`);
return moduleExports;
}

Expand Down Expand Up @@ -550,7 +548,10 @@ export class IORedisInstrumentation extends TdInstrumentationBase {
return promise;
}

private async _handleReplayConnect(spanInfo: SpanInfo, thisContext: IORedisInterface): Promise<any> {
private async _handleReplayConnect(
spanInfo: SpanInfo,
thisContext: IORedisInterface,
): Promise<any> {
logger.debug(`[IORedisInstrumentation] Replaying IORedis connect`);

// Connect operations typically don't have meaningful output to replay
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ COPY src/instrumentation/libraries/ioredis/e2e-tests/cjs-ioredis/tsconfig.json .
# Install dependencies
RUN npm install

# Add cache-busting argument to force fresh CLI download
ARG CACHEBUST=1
# Install Tusk Drift CLI
RUN curl -fsSL https://raw.githubusercontent.com/Use-Tusk/tusk-drift-cli/main/install.sh | sh

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '3.8'
version: "3.8"

services:
redis:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ COPY src/instrumentation/libraries/ioredis/e2e-tests/esm-ioredis/tsconfig.json .
# Install dependencies
RUN npm install

# Add cache-busting argument to force fresh CLI download
ARG CACHEBUST=1
# Install Tusk Drift CLI
RUN curl -fsSL https://raw.githubusercontent.com/Use-Tusk/tusk-drift-cli/main/install.sh | sh

Expand Down
Loading