> Discover all available pages from the documentation index: https://mastra.zisheng.pro/ko/llms.txt # ArthurExporter 추적 데이터를 다음으로 보냅니다.[Arthur Engine](https://github.com/arthur-ai/arthur-engine)OpenTelemetry 및 OpenInference 의미 체계 규칙을 사용합니다. ## 건설자 ```typescript new ArthurExporter(config: ArthurExporterConfig) ``` ## `ArthurExporterConfig` ```typescript type ArthurExporterConfig = Omit & { apiKey?: string endpoint?: string taskId?: string headers?: Record } ``` `OtelExporterConfig`에서 상속됩니다(`provider`와 `exporter` 제외). 포함되는 항목은 다음과 같습니다. - `timeout?: number`- 밀리초 단위로 내보내기 제한 시간(기본값: 30000) - `batchSize?: number`- 배치당 스팬 수(기본값: 512) - `logLevel?: LogLevel | 'debug' | 'info' | 'warn' | 'error'`- 로그 수준(기본값: WARN) - `resourceAttributes?: Record`- 사용자 정의 리소스 속성 ### 메타데이터 패스스루 예약되지 않은 span 속성은 OpenInference `metadata` 페이로드로 직렬화됩니다. `tracingOptions.metadata`를 통해 추가하세요(예: `companyId`, `tier`). `input`, `output`, `sessionId`, 스레드/사용자 ID, OpenInference ID와 같은 예약 필드는 자동으로 제외됩니다. ## 행동 양식 ### `exportTracingEvent` ```typescript async exportTracingEvent(event: TracingEvent): Promise ``` 추적 이벤트를 구성된 엔드포인트로 내보냅니다. ### 내보내다 ```typescript async export(spans: ReadOnlySpan[]): Promise ``` 일괄 내보내기는 OpenInference 의미 체계 규칙과 함께 OpenTelemetry를 사용하여 범위를 내보냅니다. ### 플러시 ```typescript async flush(): Promise ``` 강제는 내보내기를 종료하지 않고 버퍼링된 모든 범위를 구성된 엔드포인트로 플러시합니다. 런타임이 종료되기 전에 범위를 내보내야 하는 서버리스 환경에 유용합니다. ### 일시 휴업 ```typescript async shutdown(): Promise ``` 보류 중인 데이터를 플러시하고 클라이언트를 종료합니다. ## 용법 ### Zero-Config(환경 변수 사용) ```typescript import { ArthurExporter } from '@mastra/arthur' // Set ARTHUR_API_KEY and ARTHUR_BASE_URL (optionally ARTHUR_TASK_ID) const exporter = new ArthurExporter() ``` ### 명시적 구성 ```typescript import { ArthurExporter } from '@mastra/arthur' const exporter = new ArthurExporter({ apiKey: process.env.ARTHUR_API_KEY!, endpoint: 'http://localhost:3030', taskId: process.env.ARTHUR_TASK_ID, // Optional }) ``` ## `OpenInference`의미론적 규칙 ArthurExporter는 생성형 AI 애플리케이션을 위한 [OpenInference 시맨틱 규칙](https://github.com/Arize-ai/openinference/tree/main/spec)을 구현하여 서로 다른 Observability 플랫폼에서 표준화된 Trace 구조를 제공합니다. ## 태그 지원 ArthurExporter는 분류 및 필터링을 위한 추적 태그 지정을 지원합니다. 태그는 루트 범위에만 적용되며 기본 OpenInference에 매핑됩니다.`tag.tags` semantic convention. ### 용법 ```typescript const result = await agent.generate('Hello', { tracingOptions: { tags: ['production', 'experiment-v2', 'user-request'], }, }) ``` ### 태그가 저장되는 방법 태그는 OpenInference를 사용하여 저장됩니다.`tag.tags` attribute: ```json { "tag.tags": ["production", "experiment-v2", "user-request"] } ``` ## 관련된 - [ArthurExporter 문서](https://mastra.zisheng.pro/ko/docs/observability/integrations/exporters/arthur) - [Arthur 엔진 문서](https://docs.arthur.ai/) - [Arthur 엔진 저장소](https://github.com/arthur-ai/arthur-engine)