Skip to main content
Glama

datadog

by didlawowo

Datadog 모델 컨텍스트 프로토콜(MCP) 🔍

Datadog API와 상호 작용하고 인프라에서 모니터링 데이터를 가져오는 Python 기반 도구입니다. 이 MCP는 간단한 인터페이스를 통해 모니터링 상태 및 쿠버네티스 로그에 쉽게 액세스할 수 있도록 합니다.

Datadog 기능 🌟

  • 모니터 상태 추적 : 특정 모니터 상태를 가져오고 분석합니다.
  • Kubernetes 로그 분석 : Kubernetes 클러스터에서 오류 로그 추출 및 포맷

필수 조건 📋

  • 파이썬 3.11+
  • Datadog API 및 애플리케이션 키(올바른 권한 포함)
  • Datadog 사이트 접속

설치 🔧

Smithery를 통해 설치

Smithery를 통해 Claude Desktop용 Datadog를 자동으로 설치하려면:

지엑스피1

필요한 패키지:

datadog-api-client fastmcp loguru icecream python-dotenv uv

환경 설정 🔑

Datadog 자격 증명으로 .env 파일을 만듭니다.

DD_API_KEY=your_api_key DD_APP_KEY=your_app_key

MCP용 Claude Desktop 설정 🖥️

  1. Claude Desktop 설치
# Assuming you're on macOS brew install claude-desktop # Or download from official website https://claude.ai/desktop
  1. Datadog MCP 구성을 설정합니다.
# on mac is ~/Library/Application\ Support/Claude/claude_desktop_config.json # Add this to your claude config json ```json "Datadog-MCP-Server": { "command": "uv", "args": [ "run", "--with", "datadog-api-client", "--with", "fastmcp", "--with", "icecream", "--with", "loguru", "--with", "python-dotenv", "fastmcp", "run", "/your-path/mcp-collection/datadog/main.py" ], "env": { "DD_API_KEY": "xxxx", "DD_APP_KEY": "xxx" } },

사용법 💻

로그를 가져오다

모니터를 얻다

건축 🏗

  • FastMCP 기반 : 도구 관리를 위한 FastMCP 프레임워크 활용
  • 모듈형 디자인 : 모니터와 로그에 대한 별도 기능
  • 유형 안전성 : Python 유형 힌트를 통한 전체 유형 지원
  • API 추상화 : 오류 처리를 포함한 래핑된 Datadog API 호출

MCP와 Claude Desktop 설정에 대한 섹션을 추가하겠습니다.

모델 컨텍스트 프로토콜(MCP) 소개 🤖

MCP란 무엇인가요?

모델 컨텍스트 프로토콜(MCP)은 AI 모델이 외부 도구 및 API와 표준화된 방식으로 상호 작용할 수 있도록 하는 프레임워크입니다. Claude와 같은 모델은 MCP를 통해 다음과 같은 작업을 수행할 수 있습니다.

  • 외부 데이터 접근
  • 명령 실행
  • API와 상호 작용
  • 대화 전반에 걸쳐 맥락 유지

MCP 서버의 몇 가지 예

https://github.com/punkpeye/awesome-mcp-servers?tab=readme-ov-file

MCP 설정을 위한 튜토리얼

https://medium.com/@pedro.aquino.se/how-to-use-mcp-tools-on-claude-desktop-app-and-automate-your-daily-tasks-1c38e22bc4b0

작동 원리 - 사용 가능한 기능 🛠️

LLM은 제공된 함수를 사용하여 데이터를 가져와 사용합니다.

1. 모니터 상태 가져오기

get_monitor_states( name: str, # Monitor name to search timeframe: int = 1 # Hours to look back )

예:

response = get_monitor_states(name="traefik") # Sample Output { "id": "12345678", "name": "traefik", "status": "OK", "query": "avg(last_5m):avg:traefik.response_time{*} > 1000", "message": "Response time is too high", "type": "metric alert", "created": "2024-01-14T10:00:00Z", "modified": "2024-01-14T15:30:00Z" }

2. 쿠버네티스 로그 가져오기

get_k8s_logs( cluster: str, # Kubernetes cluster name timeframe: int = 5, # Hours to look back namespace: str = None # Optional namespace filter )

예:

logs = get_k8s_logs( cluster="prod-cluster", timeframe=3, namespace="default" ) # Sample Output { "timestamp": "2024-01-14T22:00:00Z", "host": "worker-1", "service": "nginx-ingress", "pod_name": "nginx-ingress-controller-abc123", "namespace": "default", "container_name": "controller", "message": "Connection refused", "status": "error" }
# Install as MCP extension cd datadog task install-mcp

4. 설치 확인

클로드 채팅 데스크톱에서

클로드에서 datadog 연결 확인

클로드 설정

5. Datadog MCP 도구 사용

보안 고려 사항 🔒

  • API 키를 .env 에 저장합니다.
  • MCP는 격리된 환경에서 실행됩니다.
  • 각 도구에는 정의된 권한이 있습니다.
  • 속도 제한이 구현되었습니다

문제 해결 🔧

MCP Inspector 사용

# Launch MCP Inspector for debugging task run-mcp-inspector

MCP 검사관은 다음을 제공합니다.

  • MCP 서버 상태 실시간 보기
  • 함수 호출 로그
  • 오류 추적
  • API 응답 모니터링

일반적인 문제 및 해결책

  1. API 인증 오류
    Error: (403) Forbidden
    ➡️ .env에서 DD_API_KEY와 DD_APP_KEY를 확인하세요.
  2. MCP 연결 문제
    Error: Failed to connect to MCP server
    ➡️ claude_desktop_config.json 경로와 내용을 확인하세요.
  3. 모니터를 찾을 수 없습니다
    Error: No monitor found with name 'xxx'
    ➡️ 모니터 이름의 철자와 대소문자 구분을 확인하세요
  4. 로그는 여기에서 찾을 수 있습니다

대체 텍스트

기여하기 🤝

자유롭게 하세요:

  1. 버그에 대한 공개 문제
  2. 개선을 위한 PR 제출
  3. 새로운 기능 추가

노트 📝

  • Datadog EU 사이트에 대한 API 호출이 이루어집니다.
  • 모니터 상태의 기본 시간 프레임은 1시간입니다.
  • 페이지 크기 제한은 대부분의 사용 사례를 처리하도록 설정됩니다.
-
security - not tested
F
license - not found
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

datadog에서 모니터 및 클러스터 로그에 대한 액세스를 제공합니다.

  1. Datadog 기능 🌟
    1. 필수 조건 📋
      1. 설치 🔧
        1. Smithery를 통해 설치
      2. 환경 설정 🔑
        1. MCP용 Claude Desktop 설정 🖥️
          1. Sample Output
            1. Sample Output
              1. Install as MCP extension
                1. Launch MCP Inspector for debugging
                  1. 기여하기 🤝
                  2. 노트 📝

                Related MCP Servers

                • -
                  security
                  F
                  license
                  -
                  quality
                  Integrates with Sumo Logic's API to enable log search with configurable queries and time ranges, supporting error handling and easy deployment via Docker.
                  Last updated -
                  TypeScript
                • A
                  security
                  A
                  license
                  A
                  quality
                  The MCP server provides an interface to the Datadog API, enabling seamless management of incidents, monitoring, logs, dashboards, metrics, traces, and hosts. Its extensible design allows easy integration of additional Datadog APIs for future expansions.
                  Last updated -
                  14
                  322
                  36
                  TypeScript
                  Apache 2.0
                  • Apple
                • -
                  security
                  F
                  license
                  -
                  quality
                  An MCP server that allows AI assistants to access AWS CloudWatch logs by listing log groups and reading log entries.
                  Last updated -
                  4
                  Python

                View all related MCP servers

                MCP directory API

                We provide all the information about MCP servers via our MCP API.

                curl -X GET 'https://glama.ai/api/mcp/v1/servers/didlawowo/mcp-collection'

                If you have feedback or need assistance with the MCP directory API, please join our Discord server