> Discover all available pages from the documentation index: https://mastra.zisheng.pro/ko/llms.txt # 기본 내보내기 **더 이상 사용되지 않음`@mastra/observability@1.12.0`**찬성[`MastraStorageExporter`](https://mastra.zisheng.pro/ko/reference/observability/tracing/exporters/mastra-storage-exporter). :::warning\[사용되지 않음] `DefaultExporter`는 이전 버전과의 호환성을 위해 유지되며 향후 메이저 버전에서 제거될 예정입니다. 새 프로젝트에서는 [`MastraStorageExporter`](https://mastra.zisheng.pro/ko/reference/observability/tracing/exporters/mastra-storage-exporter)를 사용하세요. 두 클래스는 생성자, 구성, 런타임 동작이 동일합니다. `DefaultExporter`는 기존 `mastra-default-observability-exporter` exporter `name`을 유지하므로 이를 기반으로 구성된 모니터링 규칙이 계속 작동합니다. ::: 자동 일괄 처리 및 재시도 논리를 사용하여 Mastra Storage에 대한 Observability 이벤트를 유지합니다. ## 건설자 ```typescript new DefaultExporter(config?: DefaultExporterConfig) ``` ## `DefaultExporterConfig` ```typescript interface DefaultExporterConfig extends BaseExporterConfig { /** Maximum number of spans per batch. Default: 1000 */ maxBatchSize?: number /** Maximum total buffer size before emergency flush. Default: 10000 */ maxBufferSize?: number /** Maximum time to wait before flushing batch in milliseconds. Default: 5000 */ maxBatchWaitMs?: number /** Maximum number of retry attempts. Default: 4 */ maxRetries?: number /** Base retry delay in milliseconds (uses exponential backoff). Default: 500 */ retryDelayMs?: number /** Tracing storage strategy or 'auto' for automatic selection. Default: 'auto' */ strategy?: TracingStorageStrategy | 'auto' } ``` `BaseExporterConfig`를 확장하며, 포함되는 항목은 다음과 같습니다. - `logger?: IMastraLogger`- 로거 인스턴스 - `logLevel?: LogLevel | 'debug' | 'info' | 'warn' | 'error'`- 로그 수준(기본값: INFO) ## `TracingStorageStrategy` ```typescript type TracingStorageStrategy = 'realtime' | 'batch-with-updates' | 'insert-only' ``` ### 전략 행동 - **실시간**: 각 이벤트를 즉시 스토리지에 지속시킵니다. - **일괄 업데이트**: 일괄 생성 및 업데이트가 별도로 이루어지며, 순서대로 적용됩니다. - **삽입 전용**: SPAN\_ENDED 이벤트만 처리하고 업데이트는 무시합니다. ## 속성 ```typescript readonly name = 'mastra-default-observability-exporter'; ``` ## 행동 양식 ### 초기화 ```typescript init(options: InitExporterOptions): void ``` 종속성이 준비된 후 내보내기를 초기화합니다. 스토리지 기능을 기반으로 추적 전략을 해결합니다. ### `exportTracingEvent` ```typescript async exportTracingEvent(event: TracingEvent): Promise ``` 해결된 전략에 따라 추적 이벤트를 처리합니다. ### 플러시 ```typescript async flush(): Promise ``` Force는 내보내기를 종료하지 않고 버퍼링된 모든 이벤트를 스토리지로 플러시합니다. 런타임이 종료되기 전에 범위를 내보내야 하는 서버리스 환경에 유용합니다. ### 일시 휴업 ```typescript async shutdown(): Promise ``` 버퍼링된 남은 이벤트를 플러시하고 정리를 수행합니다. ## 자동 전략 선택 `strategy: 'auto'`(기본값)이면 exporter가 스토리지 어댑터의 기능을 조회합니다. ```typescript interface TracingStrategy { /** Strategies supported by this adapter */ supported: TracingStorageStrategy[] /** Preferred strategy for optimal performance */ preferred: TracingStorageStrategy } ``` 수출자는 다음을 수행합니다. 1. 가능한 경우 스토리지 어댑터가 선호하는 전략을 사용하세요. 2. 선호하는 전략을 사용할 수 없는 경우 지원되는 첫 번째 전략으로 대체 3. 사용자가 지정한 전략이 지원되지 않는 경우 경고 기록 ## 일괄 처리 동작 ### 플러시 트리거 다음 조건 중 하나라도 충족되면 버퍼가 플러시됩니다. - 버퍼 크기 도달`maxBatchSize` - 첫 번째 버퍼링된 이벤트 이후 경과된 시간이 초과되었습니다.`maxBatchWaitMs` - 버퍼 크기 도달`maxBufferSize` (emergency flush) - `shutdown()`라고 ### 재시도 로직 실패한 플러시는 지수 백오프로 재시도됩니다. - 재시도 지연:`retryDelayMs * 2^attempt` - 최대 시도 횟수:`maxRetries` - 모든 재시도가 실패하면 배치가 삭제됩니다. 스토리지가 신호를 지원하지 않거나 재시도 횟수를 모두 소진하면 `DefaultExporter`는 exporter와 브리지에 등록된 `onDroppedEvent` 핸들러를 통해 `ObservabilityDropEvent`를 내보냅니다. 삭제 이벤트에는 신호, 사유, 개수, exporter 이름, 확인 가능한 경우 스토리지 이름, 정제된 오류 세부 정보가 포함됩니다. ### 비순차적 처리 을 위한`batch-with-updates` strategy: - 스팬이 생성된 트랙 - 아직 생성되지 않은 범위에 대한 업데이트/종료를 거부합니다. - 잘못된 순서의 이벤트에 대한 경고를 기록합니다. - 주문된 업데이트에 대한 일련 번호를 유지합니다. ## 용법 ```typescript import { DefaultExporter } from '@mastra/observability' // Default configuration const exporter = new DefaultExporter() // Custom batching configuration const customExporter = new DefaultExporter({ maxBatchSize: 500, maxBatchWaitMs: 2000, strategy: 'batch-with-updates', logLevel: 'debug', }) ``` ## 또한보십시오 ### 선적 서류 비치 - [추적 개요](https://mastra.zisheng.pro/ko/docs/observability/tracing/overview): 전체 가이드 - [수출업체](https://mastra.zisheng.pro/ko/docs/observability/integrations/overview): 수출업체 개념 ### 기타 수출업체 - [클라우드 내보내기](https://mastra.zisheng.pro/ko/reference/observability/tracing/exporters/cloud-exporter): 마스트라 플랫폼 - [콘솔 내보내기](https://mastra.zisheng.pro/ko/reference/observability/tracing/exporters/console-exporter): 디버그 출력 - [랭퓨즈](https://mastra.zisheng.pro/ko/reference/observability/tracing/exporters/langfuse): Langfuse 통합 - [브레인트러스트](https://mastra.zisheng.pro/ko/reference/observability/tracing/exporters/braintrust): Braintrust 통합 ### 참조 - [구성](https://mastra.zisheng.pro/ko/reference/observability/tracing/configuration): 구성 옵션 - [인터페이스](https://mastra.zisheng.pro/ko/reference/observability/tracing/interfaces): 유형 정의