GenSX provides observability tools that make it easy to understand, debug, and optimize your workflows. Every component execution is automatically traced, giving you full visibility into what’s happening inside your LLM workflows. You can view traces in real-time as workflows execute, and view historical traces to debug production issues like hallucinations.
When you run a workflow, GenSX automatically generates a trace that captures the entire execution flow, including all component inputs, outputs, and timing information.
The GenSX cloud console includes a trace viewer. You can access traces in several ways:
printUrl: true
, a direct link to the trace is printed to the console// Executing a workflow with trace URL printing
const result = await MyWorkflow({ input: "What is GenSX?" });
// Console output includes:
// [GenSX] View execution at: https://app.gensx.com/your_org/executions/your_execution_id
The flame graph visualizes the entire execution tree including branches, all nested sub-components, and timing:
Click on any component in the flame graph to inspect its details, including inputs, outputs, and timing information.
For each component in your workflow, you can inspect:
This visualization is particularly valuable for debugging production and user-reported issues like hallucinations.
The GenSX Console maintains a history of all your workflow executions, allowing you to:
Historical traces are automatically organized by project and environment, making it easy to find relevant executions.
GenSX provides flexible options for configuring and organizing traces for the GenSX Cloud serverless platform, local development, and any other deployment platform like vercel, cloudflare and AWS.
When running workflows deployed to GenSX Cloud, tracing is automatically configured:
No additional configuration is needed – everything works out of the box.
To enable tracing for workflows deployed outside of GenSX Cloud (like AWS Lambda, GCP Cloud Run, etc.), you need to set several environment variables:
# Required variables
GENSX_API_KEY=your_api_key_here
GENSX_ORG=your_gensx_org_name
GENSX_PROJECT=your_project_name
# Optional variables
GENSX_ENVIRONMENT=your_environment_name # Separate traces into specific environments
GENSX_CHECKPOINTS=false # Explicitly disable
For local development, the tracing configuration is automatically inferred from:
gensx.yaml
file in your project rootgensx
CLI in ~/.config/gensx/config
GENSX_ENVIRONMENT
environment variable can be set to separate local traces from other environmentsThe local development server started with gensx start
uses this same configuration scheme as well.
GenSX allows you to organize traces by environment (such as development, staging, production, etc.) to keep your debugging data well-structured:
# Deploy to a specific environment with its own traces
gensx deploy src/workflows.ts --env production
In the GenSX Console, you can filter traces by environment to focus on relevant executions. This separation also helps when:
Every GenSX component is automatically traced. If want to trace additional sub-steps of a workflow, wrap that code in a gensx.Component
and execute it via myComponent(props)
.
import * as gensx from "@gensx/core";
const MyWorkflow = gensx.Component(
"MyWorkflow",
async ({ input }: MyWorkflowInput) => {
// Step 1: Process input
const processedData = await ProcessData({ data: input });
// Step 2: Generate response
const response = await GenerateResponse({ data: processedData });
return response;
},
);
// Create a component to trace a specific processing step
const ProcessData = gensx.Component(
"ProcessData",
async ({ data }: ProcessDataInput) => {
// This entire function execution will be captured in traces
const parsedData = JSON.parse(data);
const enrichedData = await fetchAdditionalInfo(parsedData);
return enrichedData;
},
);
// Create a component to trace response generation
const GenerateResponse = gensx.Component(
"GenerateResponse",
async ({ data }: GenerateResponseInput) => {
// This will appear as a separate node in the trace
return `Processed result: ${JSON.stringify(data)}`;
},
);
GenSX enables you to configure which input props and outputs are marked as secrets and redacted from traces. Scrubbing happens locally before traces are sent to GenSX Cloud.
When a component executes, GenSX automatically:
[secret]
in the trace dataEven if a secret is passed down through multiple components, it remains scrubbed in all traces.
To mark specific props as containing secrets:
import * as gensx from "@gensx/core";
const AuthenticatedClient = gensx.Component(
"AuthenticatedClient",
({ apiKey, endpoint, query, credentials }: AuthenticatedClientInput) => {
// Use apiKey securely, knowing it won't appear in traces
return fetchData(endpoint, query, apiKey, credentials);
},
{
// Mark these props as containing sensitive data
secretProps: ["apiKey", "credentials.privateKey"],
},
);
The secretProps
option can specify both top-level props and nested paths using dot notation.
For components that might return sensitive information, you can mark the entire output as sensitive:
const GenerateCredentials = gensx.Component(
"GenerateCredentials",
async ({ userId }: { userId: string }) => {
// This entire output will be marked as secret
return {
accessToken: "sk-1234567890abcdef",
refreshToken: "rt-0987654321fedcba",
expiresAt: Date.now() + 3600000,
};
},
{
secretOutputs: true,
},
);
When secretOutputs
is set to true
, the entire output object or value will be treated as sensitive and masked in traces.
GenSX observability features have certain limits based on your subscription tier:
Feature | Free Tier | Pro Tier ($20/month/dev) | Enterprise |
---|---|---|---|
Traced components | 100K per month | 1M per month | Custom |
Overage cost | N/A | $0.20 per 10K components | Custom |
Trace retention | 7 days | 30 days | Custom |
Maximum input/output size | 4MB each | 4MB each | 4MB each |
A few important notes on these limits:
For use cases requiring higher limits or longer retention, contact the GenSX team for enterprise options.