> Discover all available pages from the documentation index: https://mastra.zisheng.pro/ja/llms.txt # LaminarExporter Tracing データを OTLP/HTTP(protobuf)経由で Laminar へ送信します。 ## コンストラクター ```typescript new LaminarExporter(config?: LaminarExporterConfig) ``` ## `LaminarExporterConfig` ```typescript interface LaminarExporterConfig extends BaseExporterConfig { apiKey?: string baseUrl?: string endpoint?: string headers?: Record realtime?: boolean disableBatch?: boolean batchSize?: number timeoutMillis?: number } ``` `BaseExporterConfig` を拡張し、次の項目を含みます。 - `logger?: IMastraLogger` - Logger インスタンス - `logLevel?: LogLevel | 'debug' | 'info' | 'warn' | 'error'` - ログレベル(デフォルト:INFO) ## メソッド ### `exportTracingEvent` ```typescript async exportTracingEvent(event: TracingEvent): Promise ``` Tracing イベントを Laminar へエクスポートします。 ### flush ```typescript async flush(): Promise ``` exporter をシャットダウンせず、バッファー内のすべての Span を Laminar へ強制的にフラッシュします。ランタイム終了前に Span が確実にエクスポートされるようにする必要がある、サーバーレス環境で役立ちます。 ### shutdown ```typescript async shutdown(): Promise ``` 保留中のデータをフラッシュし、exporter をシャットダウンします。 ## 使用方法 ### ゼロコンフィグ(環境変数を使用) ```typescript import { LaminarExporter } from '@mastra/laminar' // Reads from LMNR_PROJECT_API_KEY, LMNR_BASE_URL, LAMINAR_ENDPOINT const exporter = new LaminarExporter() ``` ### 明示的な設定 ```typescript import { LaminarExporter } from '@mastra/laminar' const exporter = new LaminarExporter({ apiKey: process.env.LMNR_PROJECT_API_KEY, baseUrl: 'https://api.lmnr.ai', realtime: true, }) ```