$ baro fork donghyun932/grafanamonitoringmacOS menubar app that monitors services via Grafana Cloud (Mimir/Loki/Tempo) direct endpoints with real-time health status
macOS 메뉴바 앱으로 Grafana Cloud(Mimir/Loki/Tempo)를 통해 서비스 상태를 실시간 모니터링합니다.
| 항목 | 내용 |
|---|---|
| 언어 | Swift 5.9+, SwiftUI |
| 최소 OS | macOS 14 (Sonoma) |
| 빌드 | Swift Package Manager |
| 아키텍처 | Actor 기반 GrafanaClient, @Observable 상태 관리 |
GrafanaMonitoring/
├── Package.swift
├── bundle.sh # 빌드 + .app 번들 생성 + 코드사인
└── Sources/
├── App/
│ ├── GrafanaMonitoringApp.swift # 앱 진입점
│ └── AppDelegate.swift # NSStatusItem, 메뉴바 아이콘
├── Models/
│ ├── Service.swift # MonitoredService, ServiceHealth
│ ├── MetricsData.swift # 메트릭 데이터 모델
│ └── AlertThreshold.swift # 알림 임계값
├── Services/
│ ├── GrafanaClient.swift # Prometheus/Loki/Tempo API 클라이언트
│ ├── MetricsPoller.swift # 주기적 메트릭 폴링
│ ├── NotificationManager.swift # macOS 알림
│ └── KeychainHelper.swift # API 토큰 보관
├── Views/
│ ├── MenuBarView.swift # 메인 팝오버
│ ├── ServiceRowView.swift # 서비스 행 (확장 가능)
│ ├── ServiceDetailView.swift # 메트릭 + 로그 + 트레이스
│ └── SettingsView.swift # 설정 화면
└── Utils/
└── Settings.swift # UserDefaults 기반 설정
cd GrafanaMonitoring
bash bundle.sh
open GrafanaMonitoring.app
swift run은 앱 번들이 생성되지 않아 알림 권한 등에서 크래시가 발생합니다. 반드시bundle.sh를 사용하세요.
bundle.sh는 다음을 수행합니다:
swift build로 빌드.app 번들 + Info.plist 생성앱 실행 후 Settings에서 다음을 설정합니다:
glc_ 접두사의 Cloud Access Policy 토큰| 서비스 | 엔드포인트 |
|---|---|
| Prometheus/Mimir | prometheus-prod-49-prod-ap-northeast-0.grafana.net |
| Loki | logs-prod-030.grafana.net |
| Tempo | tempo-prod-20-prod-ap-northeast-0.grafana.net |
각 서비스별로 별도의 User ID를 사용하며, Basic Auth로 인증합니다.
Private