> Discover all available pages from the documentation index: https://mastra.zisheng.pro/ko/llms.txt # Datadog수출업체 모니터링 및 분석을 위해 추적 데이터를 Datadog의 LLM Observability 제품으로 보냅니다. > **정보:** `dd-trace` APM 자동 계측도 사용하면서 이를 Mastra span 아래에 올바르게 연결해야 한다면 대신 [DatadogBridge](https://mastra.zisheng.pro/ko/reference/observability/tracing/bridges/datadog)를 사용하세요. exporter는 실행이 완료된 후 LLM Observability 데이터를 전송하므로 `dd-trace`의 실시간 span에는 관여하지 않습니다. ## 건설자 ```typescript new DatadogExporter(config: DatadogExporterConfig) ``` ## `DatadogExporterConfig` ```typescript interface DatadogExporterConfig extends BaseExporterConfig { apiKey?: string mlApp?: string site?: string service?: string env?: string agentless?: boolean integrationsEnabled?: boolean } ``` `BaseExporterConfig`를 확장하며, 포함되는 항목은 다음과 같습니다. - `logger?: IMastraLogger`- 로거 인스턴스 - `logLevel?: LogLevel | 'debug' | 'info' | 'warn' | 'error'`- 로그 수준(기본값: INFO) ## 행동 양식 ### `exportTracingEvent` ```typescript async exportTracingEvent(event: TracingEvent): Promise ``` 추적 이벤트를 Datadog LLM Observability로 내보냅니다. ### 플러시 ```typescript async flush(): Promise ``` 강제로 내보내기를 종료하지 않고 버퍼링된 모든 범위를 Datadog으로 플러시합니다. 런타임이 종료되기 전에 범위를 내보내야 하는 서버리스 환경에 유용합니다. ### 일시 휴업 ```typescript async shutdown(): Promise ``` 보류 중인 데이터를 플러시하고 내보내기를 종료합니다. 보류 중인 정리 타이머를 취소하고 LLM 관찰 기능을 비활성화합니다. ## 용법 ### Zero-Config(환경 변수 사용) ```typescript import { DatadogExporter } from '@mastra/datadog' // Reads from DD_LLMOBS_ML_APP, DD_API_KEY, DD_SITE, DD_ENV const exporter = new DatadogExporter() ``` ### 명시적 구성 ```typescript import { DatadogExporter } from '@mastra/datadog' const exporter = new DatadogExporter({ mlApp: 'my-llm-app', apiKey: process.env.DD_API_KEY, site: 'datadoghq.com', env: 'production', }) ``` ### 로컬 Datadog Agent 사용 ```typescript const exporter = new DatadogExporter({ mlApp: 'my-llm-app', agentless: false, // Use local Datadog Agent env: 'production', }) ``` ## 스팬 매핑 Mastra 범위 유형은 Datadog LLM Observability 범위 종류에 매핑됩니다. | 마스트라 스팬타입 | 데이터독 종류 | | -------------------- | ---------- | | `AGENT_RUN` | `agent` | | `MODEL_GENERATION` | `workflow` | | `MODEL_STEP` | `llm` | | `TOOL_CALL` | `tool` | | `MCP_TOOL_CALL` | `tool` | | `PROVIDER_TOOL_CALL` | `tool` | | `WORKFLOW_RUN` | `workflow` | | 기타 모든 유형 | `task` | 매핑되지 않은 모든 span 유형(`MODEL_CHUNK`, `WORKFLOW_STEP`, `GENERIC` 및 향후 span 유형 포함)은 자동으로 `task`를 기본값으로 사용합니다. ## 환경변수 내보내기는 다음 환경 변수에서 구성을 읽습니다. | 변수 | 설명 | | ----------------------------- | ----------------------------------- | | `DD_API_KEY` | Datadog API 키 | | `DD_LLMOBS_ML_APP` | ML 애플리케이션 이름 | | `DD_SITE` | Datadog 사이트 | | `DD_ENV` | 환경 이름 | | `DD_LLMOBS_AGENTLESS_ENABLED` | 로컬 Agent를 사용하려면 'false' 또는 '0'으로 설정 |