> Discover all available pages from the documentation index: https://mastra.zisheng.pro/ko/llms.txt # 아서 수출업자 [아서](https://arthur.ai/)AI 애플리케이션에 대한 Observability 및 평가 플랫폼을 제공합니다.[Arthur Engine](https://github.com/arthur-ai/arthur-engine)(오픈 소스). Arthur 내보내기는 OpenTelemetry를 사용하여 추적을 보내고[오픈인퍼런스](https://github.com/Arize-ai/openinference/tree/main/spec)의미론적 관례. ## 설치 **npm**: ```bash npm install @mastra/arthur@latest ``` **pnpm**: ```bash pnpm add @mastra/arthur@latest ``` **Yarn**: ```bash yarn add @mastra/arthur@latest ``` **Bun**: ```bash bun add @mastra/arthur@latest ``` ## 구성 ### 전제조건 1. **Arthur Engine 인스턴스**: [Docker Compose 배포 가이드](https://docs.arthur.ai/docs/arthur-genai-engine-docker-compose-deployment-guide)에 따라 Arthur Engine을 시작하세요. 2. **API 키**: `http://localhost:3030`의 Arthur Engine UI에서 [API 키를 생성하세요](https://docs.arthur.ai/docs/api-keys-management). 3. **작업 ID**(선택 사항): 특정 작업으로 Trace를 라우팅하려면 [작업을 생성하세요](https://docs.arthur.ai/docs/create-a-task). ### 작업 라우팅 Arthur Engine은 두 가지 방법으로 추적을 작업과 연결합니다. - **서비스 이름 기준**: Observability 설정에서 `serviceName`을 설정합니다. Arthur Engine은 Trace를 해당 이름과 일치하는 작업으로 자동 라우팅하며 필요하면 작업을 생성합니다. - **작업 ID 기준**: 기존 `taskId`를 Exporter에 전달하여 Trace를 특정 작업으로 직접 전송합니다. 둘 다 제공되는 경우,`taskId` takes precedence. ### 환경변수 ```bash # Required ARTHUR_API_KEY=your-api-key ARTHUR_BASE_URL=http://localhost:3030 # Optional - route traces to a pre-existing task by ID ARTHUR_TASK_ID=your-task-id ``` ### 제로 구성 설정 환경 변수가 설정된 경우 구성 없이 내보내기를 사용합니다. ```typescript import { Mastra } from '@mastra/core' import { Observability } from '@mastra/observability' import { ArthurExporter } from '@mastra/arthur' export const mastra = new Mastra({ observability: new Observability({ configs: { arthur: { serviceName: 'my-service', exporters: [new ArthurExporter()], }, }, }), }) ``` ### 명시적 구성 자격 증명을 직접 전달할 수도 있습니다(환경 변수보다 우선 적용됨). ```typescript import { Mastra } from '@mastra/core' import { Observability } from '@mastra/observability' import { ArthurExporter } from '@mastra/arthur' export const mastra = new Mastra({ observability: new Observability({ configs: { arthur: { serviceName: 'my-service', exporters: [ new ArthurExporter({ apiKey: process.env.ARTHUR_API_KEY!, endpoint: process.env.ARTHUR_BASE_URL!, taskId: process.env.ARTHUR_TASK_ID, }), ], }, }, }), }) ``` ## 구성 옵션 ### 완전한 구성 ```typescript new ArthurExporter({ // Arthur Configuration apiKey: 'your-api-key', // Required endpoint: 'http://localhost:3030', // Required taskId: 'your-task-id', // Optional // Optional OTLP settings headers: { 'x-custom-header': 'value', // Additional headers for OTLP requests }, // Debug and performance tuning logLevel: 'debug', // Logging: debug | info | warn | error batchSize: 512, // Batch size before exporting spans timeout: 30000, // Timeout in ms before exporting spans // Custom resource attributes resourceAttributes: { 'deployment.environment': process.env.NODE_ENV, 'service.version': process.env.APP_VERSION, }, }) ``` ### 커스텀 메타데이터 예약되지 않은 Span 속성은 OpenInference `metadata` 페이로드로 직렬화되어 Arthur에 표시됩니다. `tracingOptions.metadata`를 통해 추가할 수 있습니다. ```ts await agent.generate(input, { tracingOptions: { metadata: { companyId: 'acme-co', tier: 'enterprise', }, }, }) ``` `input`, `output`, `sessionId`, 스레드/사용자 ID, OpenInference ID 같은 예약 필드는 자동으로 제외됩니다. ## OpenInference 의미론적 규칙 이 Exporter는 생성형 AI 애플리케이션을 위한 [OpenInference 의미 체계 규칙](https://github.com/Arize-ai/openinference/tree/main/spec)을 구현하여 서로 다른 Observability 플랫폼에서 표준화된 Trace 구조를 제공합니다. ## 관련된 - [추적 개요](https://mastra.zisheng.pro/ko/docs/observability/tracing/overview) - [ArthurExporter 참조](https://mastra.zisheng.pro/ko/reference/observability/tracing/exporters/arthur) - [Arthur 엔진 문서](https://docs.arthur.ai/) - [Arthur 엔진 저장소](https://github.com/arthur-ai/arthur-engine) - [오픈인퍼런스 사양](https://github.com/Arize-ai/openinference/tree/main/spec)