Prometheus Setup
The flexFS metadata server and proxy server expose Prometheus metrics on their HTTP /metrics endpoint. This page covers how to configure Prometheus to scrape these targets.
Endpoints
Section titled “Endpoints”| Server | Default endpoint | Protocol |
|---|---|---|
meta.flexfs | https://<meta-addr>/metrics | HTTPS (unless --noSSL) |
proxy.flexfs | https://<proxy-addr>/metrics | HTTPS (unless --noSSL) |
The metrics endpoint is served on the same bind address and port as the main server.
Scrape configuration
Section titled “Scrape configuration”Add the following jobs to your prometheus.yml:
Metadata server
Section titled “Metadata server”scrape_configs: - job_name: "flexfs-meta" scheme: https tls_config: insecure_skip_verify: true static_configs: - targets: - "meta-server-1:443" labels: instance: "meta-server-1"Proxy server
Section titled “Proxy server” - job_name: "flexfs-proxy" scheme: https tls_config: insecure_skip_verify: true static_configs: - targets: - "proxy-server-1:443" - "proxy-server-2:443" labels: region: "us-east-1"Using a trusted CA
Section titled “Using a trusted CA”scrape_configs: - job_name: "flexfs-meta" scheme: https tls_config: ca_file: /path/to/ca.pem static_configs: - targets: - "meta-server-1:443"Without TLS
Section titled “Without TLS”If the servers are running with --noSSL:
scrape_configs: - job_name: "flexfs-meta" scheme: http static_configs: - targets: - "meta-server-1:8080"Kubernetes service discovery
Section titled “Kubernetes service discovery”If flexFS servers are running inside Kubernetes, use kubernetes_sd_configs or a ServiceMonitor (with Prometheus Operator):
ServiceMonitor example
Section titled “ServiceMonitor example”apiVersion: monitoring.coreos.com/v1kind: ServiceMonitormetadata: name: flexfs-meta labels: app: flexfs-metaspec: selector: matchLabels: app: flexfs-meta endpoints: - port: https scheme: https tlsConfig: insecureSkipVerify: true interval: 15sRelabeling
Section titled “Relabeling”To add meaningful labels to your metrics, use relabel_configs:
scrape_configs: - job_name: "flexfs-meta" scheme: https tls_config: insecure_skip_verify: true static_configs: - targets: ["meta-1:443"] labels: environment: "production" region: "us-east-1"Scrape interval
Section titled “Scrape interval”A 15-second scrape interval works well for most deployments. For high-throughput environments, you may reduce it to 10 seconds. Avoid intervals shorter than 5 seconds to minimize overhead.
scrape_configs: - job_name: "flexfs-meta" scrape_interval: 15s scrape_timeout: 10s # ...Verifying metrics
Section titled “Verifying metrics”Test that metrics are reachable:
# Metadata servercurl -sk https://meta-server-1:443/metrics | head -20
# Proxy servercurl -sk https://proxy-server-1:443/metrics | head -20You should see lines like:
# HELP flexfs_meta_rpc_ops_total Total RPC operations by method and status.# TYPE flexfs_meta_rpc_ops_total counterflexfs_meta_rpc_ops_total{volume_id="abc123",method="Lookup",status="ok"} 42Next steps
Section titled “Next steps”- Metrics reference — full catalog of all metrics
- Grafana dashboards — visualize the data
- Alerting — set up alerts on key metrics