LaminarExporter
Sends Tracing data to Laminar via OTLP/HTTP (protobuf).
ConstructorDirect link to Constructor
new LaminarExporter(config?: LaminarExporterConfig)
LaminarExporterConfigDirect link to LaminarExporterConfig
interface LaminarExporterConfig extends BaseExporterConfig {
apiKey?: string;
baseUrl?: string;
endpoint?: string;
headers?: Record<string, string>;
realtime?: boolean;
disableBatch?: boolean;
batchSize?: number;
timeoutMillis?: number;
}
Extends BaseExporterConfig, which includes:
logger?: IMastraLogger- Logger instancelogLevel?: LogLevel | 'debug' | 'info' | 'warn' | 'error'- Log level (default: INFO)
MethodsDirect link to Methods
exportTracingEventDirect link to exportTracingEvent
async exportTracingEvent(event: TracingEvent): Promise<void>
Exports a tracing event to Laminar.
flushDirect link to flush
async flush(): Promise<void>
Force flushes any buffered spans to Laminar without shutting down the exporter. Useful in serverless environments where you need to ensure spans are exported before the runtime terminates.
shutdownDirect link to shutdown
async shutdown(): Promise<void>
Flushes pending data and shuts down the exporter.
UsageDirect link to Usage
Zero-Config (using environment variables)Direct link to Zero-Config (using environment variables)
import { LaminarExporter } from "@mastra/laminar";
// Reads from LMNR_PROJECT_API_KEY, LMNR_BASE_URL, LAMINAR_ENDPOINT
const exporter = new LaminarExporter();
Explicit ConfigurationDirect link to Explicit Configuration
import { LaminarExporter } from "@mastra/laminar";
const exporter = new LaminarExporter({
apiKey: process.env.LMNR_PROJECT_API_KEY,
baseUrl: "https://api.lmnr.ai",
realtime: true,
});