Skip to content

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.

ServerDefault endpointProtocol
meta.flexfshttps://<meta-addr>/metricsHTTPS (unless --noSSL)
proxy.flexfshttps://<proxy-addr>/metricsHTTPS (unless --noSSL)

The metrics endpoint is served on the same bind address and port as the main server.

Add the following jobs to your prometheus.yml:

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"
- 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"
scrape_configs:
- job_name: "flexfs-meta"
scheme: https
tls_config:
ca_file: /path/to/ca.pem
static_configs:
- targets:
- "meta-server-1:443"

If the servers are running with --noSSL:

scrape_configs:
- job_name: "flexfs-meta"
scheme: http
static_configs:
- targets:
- "meta-server-1:8080"

If flexFS servers are running inside Kubernetes, use kubernetes_sd_configs or a ServiceMonitor (with Prometheus Operator):

apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: flexfs-meta
labels:
app: flexfs-meta
spec:
selector:
matchLabels:
app: flexfs-meta
endpoints:
- port: https
scheme: https
tlsConfig:
insecureSkipVerify: true
interval: 15s

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"

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
# ...

Test that metrics are reachable:

Terminal window
# Metadata server
curl -sk https://meta-server-1:443/metrics | head -20
# Proxy server
curl -sk https://proxy-server-1:443/metrics | head -20

You should see lines like:

# HELP flexfs_meta_rpc_ops_total Total RPC operations by method and status.
# TYPE flexfs_meta_rpc_ops_total counter
flexfs_meta_rpc_ops_total{volume_id="abc123",method="Lookup",status="ok"} 42