f1feb5c2f7
Native Headlamp integrations: - registerResourceTableColumnsProcessor: add Protocol/Pool/Server columns to native StorageClass table and Protocol/Volume Handle to PV table - registerDetailsViewSection: inject TNS-CSI section into PV detail pages - registerDetailsViewSection: inject driver role/status into tns-csi Pod pages - registerDetailsViewHeaderAction: Benchmark shortcut on StorageClass detail - registerAppBarAction: driver health badge (N/Nc M/Mn, color-coded) - Trim sidebar from 6 → 4 entries (Overview, Snapshots, Metrics, Benchmark) TrueNAS API integration: - src/api/truenas.ts: ConfigStore-backed settings, WebSocket JSON-RPC client for pool.query (auth.login_with_api_key + pool.query) - src/components/TnsCsiSettings.tsx: API key + server override settings UI with connection test button - TnsCsiDataContext: fetch real pool stats (size/allocated/free/status) - OverviewPage: three-tier pool capacity display (real data → error → metrics fallback) Documentation: - README, CHANGELOG, CONTRIBUTING, SECURITY - docs/: architecture, deployment (Helm), getting-started, user-guide, troubleshooting CI: - .github/workflows/ci.yaml: lint + type-check + test on PR/push - .github/workflows/release.yaml: workflow_dispatch versioned release Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
69 lines
2.2 KiB
Markdown
69 lines
2.2 KiB
Markdown
# Metrics Issues
|
|
|
|
## Metrics Page Shows No Data
|
|
|
|
### 1. Check the Controller Pod Is Running
|
|
|
|
```bash
|
|
kubectl get pods -n kube-system \
|
|
-l app.kubernetes.io/name=tns-csi-driver,app.kubernetes.io/component=controller
|
|
```
|
|
|
|
The controller pod must be in `Running` state with all containers ready.
|
|
|
|
### 2. Verify Port 8080 Is Exposed
|
|
|
|
```bash
|
|
# Check the pod spec for port 8080
|
|
kubectl get pod -n kube-system <controller-pod-name> -o yaml | grep -A5 "ports:"
|
|
```
|
|
|
|
If port 8080 is not declared, the tns-csi driver version you're running may not expose Prometheus metrics. Check the driver documentation.
|
|
|
|
### 3. Test the Metrics Endpoint Directly
|
|
|
|
```bash
|
|
# Port-forward the controller pod
|
|
kubectl port-forward -n kube-system \
|
|
$(kubectl get pods -n kube-system -l app.kubernetes.io/name=tns-csi-driver,app.kubernetes.io/component=controller -o name | head -1) \
|
|
8080:8080
|
|
|
|
# In another terminal
|
|
curl http://localhost:8080/metrics | head -20
|
|
```
|
|
|
|
If this returns Prometheus text format output, the endpoint is working. If it returns 404 or connection refused, the controller isn't exposing metrics.
|
|
|
|
### 4. Check RBAC for Pod Proxy
|
|
|
|
The plugin accesses metrics via the Kubernetes pod proxy sub-resource:
|
|
|
|
```
|
|
GET /api/v1/namespaces/kube-system/pods/<pod>/proxy/metrics
|
|
```
|
|
|
|
This requires `get` on `pods/proxy` in `kube-system`:
|
|
|
|
```bash
|
|
kubectl auth can-i get pods/proxy \
|
|
-n kube-system \
|
|
--as=system:serviceaccount:kube-system:headlamp
|
|
```
|
|
|
|
### 5. Network Policies
|
|
|
|
If `kube-system` has NetworkPolicies, ensure the Kubernetes API server can reach the controller pod on port 8080. The pod proxy hop is performed by the API server, not by Headlamp directly.
|
|
|
|
## Metrics Show Stale Values
|
|
|
|
The Metrics page fetches data on-demand when the page loads. Click **Refresh** to re-fetch the latest metrics from the controller pod.
|
|
|
|
## Some Metric Cards Show "—"
|
|
|
|
Not all tns-csi driver versions expose all metrics. The plugin shows placeholder "—" values for metrics that are absent from the Prometheus output. This is expected behavior.
|
|
|
|
The plugin specifically looks for:
|
|
- `kubelet_volume_stats_*` metrics (volume I/O)
|
|
- `csi_operations_seconds_*` metrics (CSI operation latency)
|
|
- Any tns-csi specific metrics on port 8080
|