LaminarExporter
Sends Tracing data to Laminar via OTLP/HTTP (protobuf).
ConstructorConstructor的直接链接
new LaminarExporter(config?: LaminarExporterConfig)
LaminarExporterConfiglaminarexporterconfig的直接链接
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)
MethodsMethods的直接链接
exportTracingEventexporttracingevent的直接链接
async exportTracingEvent(event: TracingEvent): Promise<void>
Exports a tracing event to Laminar.
flushflush的直接链接
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.
shutdownshutdown的直接链接
async shutdown(): Promise<void>
Flushes pending data and shuts down the exporter.
UsageUsage的直接链接
Zero-Config (using environment variables)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 ConfigurationExplicit Configuration的直接链接
import { LaminarExporter } from '@mastra/laminar'
const exporter = new LaminarExporter({
apiKey: process.env.LMNR_PROJECT_API_KEY,
baseUrl: 'https://api.lmnr.ai',
realtime: true,
})