Skip to content

Commit 898fbe0

Browse files
Copilot0xrinegade
andcommitted
Implement comprehensive autoscaling capabilities with Prometheus metrics and Kubernetes HPA
Co-authored-by: 0xrinegade <[email protected]>
1 parent 404c2c7 commit 898fbe0

File tree

15 files changed

+1561
-62
lines changed

15 files changed

+1561
-62
lines changed

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,6 @@ base64 = "0.22"
2727
bs58 = "0.5"
2828
bincode = "1.3"
2929
reqwest = { version = "0.11", features = ["json"] }
30+
prometheus = "0.13"
31+
axum = "0.7"
32+
tower = "0.5"

README.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ TEMP_DIR=$(mktemp -d) && cd "$TEMP_DIR" && git clone https://github.com/opensvm/
4040
# Docker container
4141
./scripts/deploy-docker.sh
4242

43-
# Kubernetes
43+
# Kubernetes with autoscaling
4444
./scripts/deploy-k8s.sh
4545

4646
# AWS Lambda
@@ -55,6 +55,39 @@ TEMP_DIR=$(mktemp -d) && cd "$TEMP_DIR" && git clone https://github.com/opensvm/
5555

5656
See [`scripts/README.md`](scripts/README.md) for detailed usage and requirements for each deployment option.
5757

58+
## ⚡ Autoscaling and Monitoring
59+
60+
The Solana MCP Server supports dynamic scaling to handle variable load efficiently:
61+
62+
### Features
63+
- **Prometheus metrics** exposed at `/metrics` endpoint
64+
- **Kubernetes HPA** with CPU, memory, and custom metrics
65+
- **Docker scaling** guidelines and automation scripts
66+
- **Health checks** at `/health` endpoint
67+
68+
### Metrics Exposed
69+
- `solana_mcp_rpc_requests_total` - Total RPC requests by method and network
70+
- `solana_mcp_rpc_request_duration_seconds` - Request latency histogram
71+
- `solana_mcp_rpc_requests_failed_total` - Failed requests by error type
72+
- Standard resource metrics (CPU, memory)
73+
74+
### Quick Start with Autoscaling
75+
76+
```bash
77+
# Deploy with Kubernetes autoscaling
78+
kubectl apply -f k8s/deployment.yaml
79+
kubectl apply -f k8s/hpa.yaml
80+
81+
# Check autoscaling status
82+
kubectl get hpa solana-mcp-server-hpa --watch
83+
84+
# Access metrics
85+
kubectl port-forward svc/solana-mcp-service 8080:8080
86+
curl http://localhost:8080/metrics
87+
```
88+
89+
📊 **[Complete Autoscaling Documentation](./docs/metrics.md)** | 🐳 **[Docker Scaling Guide](./docs/docker-scaling.md)**
90+
5891
## Available RPC Methods
5992

6093
### Account Methods

0 commit comments

Comments
 (0)