setup-uptime-checks
정보
이 스킬은 고객 대면 엔드포인트를 대상으로 Blackbox Exporter와 Prometheus를 활용한 외부 가동 시간 모니터링을 구성합니다. SSL 인증서 만료 추적, HTTP 헬스 체크, SLA 보고용 상태 페이지를 구현합니다. 여러 지역에서 서비스 가용성을 검증하거나 공개 상태 대시보드를 생성해야 할 때 사용하세요.
빠른 설치
Claude Code
추천npx skills add pjt222/agent-almanac -a claude-code/plugin add https://github.com/pjt222/agent-almanacgit clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/setup-uptime-checksClaude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요
문서
設可用之察
自外觀察服之可用,且防 SSL 證書過期。
用時
- 監對客之端(API、網)乃用
- 跟 SSL 證書之過期乃用
- 自多域驗服之可用乃用
- 立公之狀頁乃用
- 達 SLA 之可用報之求乃用
入
- 必要:欲監之 HTTP/HTTPS 端列
- 必要:為指收之 Prometheus 實
- 可選:多地之探位
- 可選:狀頁之器(Statuspage.io、Cachet、自定)
- 可選:警之渠(PagerDuty、Slack)
法
詳備之配與模板,參 Extended Examples。
第一步:展 Blackbox Exporter
以 Docker 或 Kubernetes 裝 Blackbox Exporter:
# Docker deployment
docker run -d \
--name blackbox-exporter \
-p 9115:9115 \
-v $(pwd)/blackbox.yml:/etc/blackbox_exporter/config.yml \
prom/blackbox-exporter:latest \
--config.file=/etc/blackbox_exporter/config.yml
Kubernetes 之展:
# blackbox-exporter-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: blackbox-exporter
namespace: monitoring
spec:
replicas: 1
selector:
matchLabels:
app: blackbox-exporter
template:
metadata:
labels:
app: blackbox-exporter
spec:
containers:
- name: blackbox-exporter
image: prom/blackbox-exporter:latest
ports:
- containerPort: 9115
volumeMounts:
- name: config
mountPath: /etc/blackbox_exporter
volumes:
- name: config
configMap:
name: blackbox-exporter-config
---
apiVersion: v1
kind: Service
metadata:
name: blackbox-exporter
namespace: monitoring
spec:
selector:
app: blackbox-exporter
ports:
- port: 9115
targetPort: 9115
得:Blackbox Exporter 行而於端口 9115 可達。
敗則:察防火牆規,確配卷掛正。
第二步:配 Blackbox 之模
立 blackbox.yml 附諸探類:
# blackbox.yml
modules:
# Basic HTTP 200 check
http_2xx:
prober: http
timeout: 5s
http:
valid_status_codes: [200]
method: GET
follow_redirects: true
preferred_ip_protocol: "ip4"
# HTTP with authentication
http_2xx_auth:
prober: http
timeout: 5s
http:
valid_status_codes: [200]
method: GET
headers:
Authorization: "Bearer ${AUTH_TOKEN}"
# API health check (expects JSON response)
http_json_health:
prober: http
timeout: 5s
http:
valid_status_codes: [200]
method: GET
fail_if_body_not_matches_regexp:
- '"status":"healthy"'
# SSL certificate check
http_2xx_ssl:
prober: http
timeout: 5s
http:
valid_status_codes: [200]
method: GET
tls_config:
insecure_skip_verify: false
fail_if_ssl_not_present: true
# TCP port check (e.g., database)
tcp_connect:
prober: tcp
timeout: 5s
tcp:
preferred_ip_protocol: "ip4"
# ICMP ping
icmp:
prober: icmp
timeout: 5s
icmp:
preferred_ip_protocol: "ip4"
# DNS resolution check
dns_google:
prober: dns
timeout: 5s
dns:
query_name: "google.com"
query_type: "A"
valid_rcodes:
- NOERROR
載配於 Kubernetes:
kubectl create configmap blackbox-exporter-config \
-n monitoring \
--from-file=blackbox.yml \
--dry-run=client -o yaml | kubectl apply -f -
得:諸探之模已配為異察類。
敗則:驗 YAML 語法。察 Blackbox Exporter 之日為配誤。
第三步:配 Prometheus 之抓
加 Blackbox 之目於 Prometheus 配:
# prometheus.yml
scrape_configs:
# Blackbox exporter itself
- job_name: 'blackbox-exporter'
static_configs:
- targets: ['blackbox-exporter:9115']
# HTTP endpoint checks
- job_name: 'blackbox-http'
metrics_path: /probe
params:
module: [http_2xx]
static_configs:
- targets:
- https://api.company.com/health
- https://www.company.com
- https://app.company.com/login
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: blackbox-exporter:9115
# SSL certificate expiry checks
- job_name: 'blackbox-ssl'
metrics_path: /probe
params:
module: [http_2xx_ssl]
static_configs:
- targets:
- https://api.company.com
- https://www.company.com
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: blackbox-exporter:9115
# TCP connectivity checks (databases, etc.)
- job_name: 'blackbox-tcp'
metrics_path: /probe
params:
module: [tcp_connect]
static_configs:
- targets:
- postgres.internal:5432
- redis.internal:6379
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: blackbox-exporter:9115
重載 Prometheus 配:
# Reload Prometheus (if running in Docker)
docker exec prometheus kill -HUP 1
# Or Kubernetes
kubectl rollout restart deployment/prometheus -n monitoring
得:Prometheus 抓 Blackbox Exporter,指於 Prometheus UI 可見。
敗則:察 Prometheus 日為抓誤。驗 Blackbox Exporter 可達。
第四步:立可用之警
定警則:
# uptime-alerts.yml
groups:
- name: uptime
interval: 30s
rules:
- alert: EndpointDown
expr: probe_success == 0
for: 2m
labels:
severity: critical
annotations:
summary: "Endpoint {{ $labels.instance }} is down"
description: "{{ $labels.instance }} has been unreachable for 2 minutes."
- alert: SSLCertificateExpiringSoon
expr: (probe_ssl_earliest_cert_expiry - time()) / 86400 < 14
for: 1h
labels:
severity: warning
annotations:
summary: "SSL certificate for {{ $labels.instance }} expires in {{ $value | humanizeDuration }}"
description: "Certificate expires on {{ $labels.instance }}. Renew soon."
- alert: SSLCertificateExpired
expr: (probe_ssl_earliest_cert_expiry - time()) < 0
for: 5m
labels:
severity: critical
annotations:
summary: "SSL certificate for {{ $labels.instance }} has EXPIRED"
description: "URGENT: Certificate expired. Service may be inaccessible."
- alert: SlowResponseTime
expr: probe_http_duration_seconds > 3
for: 5m
labels:
severity: warning
annotations:
summary: "Slow response from {{ $labels.instance }}"
description: "HTTP request took {{ $value }}s (threshold: 3s)."
- alert: HTTPStatusNot200
expr: probe_http_status_code != 200
for: 2m
labels:
severity: warning
annotations:
summary: "HTTP {{ $labels.instance }} returned {{ $value }}"
description: "Expected 200, got {{ $value }}."
載入 Prometheus:
# Add to prometheus.yml
rule_files:
- /etc/prometheus/uptime-alerts.yml
# Reload
docker exec prometheus kill -HUP 1
得:端不可達或 SSL 證將過期則警觸。
敗則:察 Prometheus 警頁之則評誤。
第五步:立可用之儀表
立 Grafana 儀表:
{
"dashboard": {
"title": "Uptime Monitoring",
"panels": [
{
"title": "Endpoint Availability (7 days)",
# ... (see EXAMPLES.md for complete configuration)
得:儀表示可用百分、SSL 過期、應時。
敗則:察 Grafana 之 Prometheus 數源,驗指被抓。
第六步:設狀頁
法甲:用 Statuspage.io(SaaS):
# Integrate with Statuspage.io API
curl -X POST https://api.statuspage.io/v1/pages/PAGE_ID/incidents \
-H "Authorization: OAuth YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"incident": {
"name": "API Degradation",
"status": "investigating",
"impact_override": "minor",
"body": "We are investigating elevated error rates on the API."
}
}'
法乙:自宿 Cachet:
# docker-compose.yml for Cachet
version: '3'
services:
cachet:
image: cachethq/docker:latest
ports:
# ... (see EXAMPLES.md for complete configuration)
法丙:自定狀頁,自 Prometheus 指:
<!-- Simple status page (served via Nginx or GitHub Pages) -->
<!DOCTYPE html>
<html>
<head>
<title>Company Status</title>
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
# ... (see EXAMPLES.md for complete configuration)
得:公狀頁示當前服狀與事件。
敗則:確狀頁之網址客可達,非藏於 VPN。
驗
- Blackbox Exporter 已展而可達
- Prometheus 抓 Blackbox 之指
- 諸要端皆配可用之察
- SSL 證過期之警已配(14 日之警)
- 警已試(模端不可達,察警觸)
- Grafana 儀表示可用與 SSL 過期
- 狀頁客可訪
- 警通達於值班工程師
陷
- 唯內之察:集內之 Blackbox Exporter 不能察外 DNS/路由之患。於多雲/多域展探
- 抓過頻:每 10 秒察生負。30-60s 常足
- 無 SSL 之監:證過期可恥可防。常監之
- 狀頁不自動:事件中人手更狀頁費時。自 Prometheus 警自動之
- 假陽:單敗之察不應警。用
for: 2m以避暫網之閃
參
configure-alerting-rules— 為可用敗立警setup-prometheus-monitoring— 為 Blackbox Exporter 之 Prometheus 後端
GitHub 저장소
연관 스킬
content-collections
메타이 스킬은 콘텐츠 콜렉션(Content Collections)을 위한 프로덕션 검증된 설정을 제공합니다. 콘텐츠 콜렉션은 Markdown/MDX 파일을 Zod 검증이 포함된 타입 안전한 데이터 콜렉션으로 변환해주는 TypeScript 최우선 도구입니다. 블로그, 문서 사이트 또는 콘텐츠 중심의 Vite + React 애플리케이션을 구축할 때 타입 안전성과 자동 콘텐츠 검증을 보장하기 위해 사용하세요. Vite 플러그인 구성과 MDX 컴파일부터 배포 최적화 및 스키마 검증에 이르기까지 모든 것을 다룹니다.
polymarket
메타이 스킬은 개발자들이 Polymarket 예측 시장 플랫폼을 활용한 애플리케이션을 구축할 수 있도록 지원하며, 거래 및 시장 데이터를 위한 API 통합 기능을 포함합니다. 또한 WebSocket을 통한 실시간 데이터 스트리밍을 제공하여 실시간 거래와 시장 활동을 모니터링할 수 있습니다. 이를 통해 거래 전략을 구현하거나 실시간 시장 업데이트를 처리하는 도구를 생성하는 데 활용할 수 있습니다.
creating-opencode-plugins
메타이 스킬은 개발자들이 명령어, 파일, LSP 작업 등 25개 이상의 이벤트 유형에 연결되는 OpenCode 플러그인을 만들 수 있도록 돕습니다. JavaScript/TypeScript 모듈을 위한 플러그인 구조, 이벤트 API 명세, 구현 패턴을 제공합니다. OpenCode AI 어시스턴트의 라이프사이클을 사용자 정의 이벤트 기반 로직으로 가로채거나, 모니터링하거나, 확장해야 할 때 사용하세요.
sglang
메타SGLang은 RadixAttention 프리픽스 캐싱을 활용하여 JSON, 정규식, 에이전트 워크플로우를 위한 고속 구조화 생성에 특화된 고성능 LLM 서빙 프레임워크입니다. 특히 반복되는 프리픽스가 있는 작업에서 상당히 빠른 추론 속도를 제공하여 복잡한 구조화 출력 및 다중 턴 대화에 이상적입니다. 제약 디코딩이 필요하거나 광범위한 프리픽스 공유가 있는 애플리케이션을 구축할 때는 vLLM과 같은 대안보다 SGLang을 선택하십시오.
