Metrics proxy¶
Overview¶
The Metrics Proxy exposes a Prometheus-compatible HTTP API that lets you query F5 Insight metrics data directly from your own dashboards, scripts, or any Prometheus-compatible tool. The proxy authenticates requests with HTTP Basic Auth and proxied to F5 Insight’s internal time-series database (VictoriaMetrics).
How it works¶
Your Dashboard / Script / Tool
|
| HTTPS + HTTP Basic Auth
v
F5 Insight Backend (/api/metrics_proxy/api/v1/*)
|
| Strips /api/metrics_proxy prefix
| Removes Authorization header
v
VictoriaMetrics (/api/v1/*)
- Requests are authenticated with HTTP Basic Auth (F5 Insight username and password).
- The proxy strips the
/api/metrics_proxypath prefix before forwarding to the TSDB (Time Series Database). - The
Authorizationheader is never forwarded to VictoriaMetrics. - The proxy adds CORS headers to all responses, so browser-based tools can query directly.
Base URL¶
https://<f5-insight-host>/api/metrics_proxy/api/v1
Important
HTTPS required. Plain HTTP requests receive a 301 Moved Permanently redirect. Always use https://.
Example
https://<f5-insight-host>/api/metrics_proxy/api/v1
Authentication¶
All endpoints require HTTP Basic Authentication using your F5 Insight login credentials.
Authorization: Basic <base64(username:password)>
curl handles this automatically with the -u flag:
curl -u "admin:<password>" \
"https://<f5-insight-host>/api/metrics_proxy/api/v1/labels"
If the server uses a self-signed certificate, add -k to skip TLS verification:
curl -k -u "admin:<password>" \
"https://<f5-insight-host>/api/metrics_proxy/api/v1/labels"
Failure response
HTTP/1.1 401 Unauthorized
WWW-Authenticate: Basic realm="F5 Insights Metrics Proxy"
Content-Type: application/json
{
"status": "error",
"error": "Invalid username or password"
}
Available endpoints¶
All endpoints follow the standard Prometheus HTTP API v1 interface.
Instant query¶
Query the current value of a metric (or at a specific point in time).
| Method | Path |
|---|---|
GET / POST |
/query |
| Parameter | Type | Required | Description |
|---|---|---|---|
query |
string | Yes | PromQL expression |
time |
RFC3339 or Unix timestamp | No | Evaluation time (defaults to now) |
timeout |
duration string (for example, 30s) |
No | Evaluation timeout |
# GET
curl -u "admin:pass" \
"https://<f5-insight-host>/api/metrics_proxy/api/v1/query?query=up"
# POST
curl -u "admin:pass" -X POST \
"https://<f5-insight-host>/api/metrics_proxy/api/v1/query" \
--data-urlencode "query=up" \
--data-urlencode "time=2024-01-01T00:00:00Z"
Range query¶
Query a metric over a time range. Use this to power time-series charts in your own dashboard.
| Method | Path |
|---|---|
GET / POST |
/query_range |
| Parameter | Type | Required | Description |
|---|---|---|---|
query |
string | Yes | PromQL expression |
start |
RFC3339 or Unix timestamp | Yes | Start of range |
end |
RFC3339 or Unix timestamp | Yes | End of range |
step |
duration or float (seconds) | Yes | Resolution step |
timeout |
duration string | No | Evaluation timeout |
curl -u "admin:pass" \
"https://<f5-insight-host>/api/metrics_proxy/api/v1/query_range" \
--get \
--data-urlencode "query=rate(http_requests_total[5m])" \
--data-urlencode "start=2024-01-01T00:00:00Z" \
--data-urlencode "end=2024-01-01T01:00:00Z" \
--data-urlencode "step=60s"
Series metadata¶
Discover what time series are available.
| Method | Path |
|---|---|
GET / POST / DELETE |
/series |
| Parameter | Type | Required | Description |
|---|---|---|---|
match[] |
series selector | Yes | One or more selector strings |
start |
timestamp | No | Start time |
end |
timestamp | No | End time |
curl -u "admin:pass" \
"https://<f5-insight-host>/api/metrics_proxy/api/v1/series?match[]=up"
Labels¶
Discover available label names and their values. Useful for building dynamic filters in your dashboard.
| Method | Path | Description |
|---|---|---|
GET / POST |
/labels |
List all label names |
GET |
/label/{name}/values |
List all values for a label |
# All label names
curl -u "admin:pass" \
"https://<f5-insight-host>/api/metrics_proxy/api/v1/labels"
# Values for a specific label
curl -u "admin:pass" \
"https://<f5-insight-host>/api/metrics_proxy/api/v1/label/job/values"
Metadata and targets¶
| Method | Path | Description |
|---|---|---|
GET |
/metadata |
Metric metadata (type, help text) |
GET |
/targets |
Current scrape targets and their state |
GET |
/targets/metadata |
Metadata per scrape target |
Rules and alerts¶
| Method | Path | Description |
|---|---|---|
GET |
/rules |
Loaded alerting and recording rules |
GET |
/alerts |
Currently firing alerts |
GET |
/alertmanagers |
Discovered Alertmanager instances |
Query examples¶
The following PromQL expressions work with the /query and /query_range endpoints.
CPU utilization across all BIG-IP devices¶
avg by (device) (bigip_cpu_utilization_5s)
HTTP request rate (last 5 minutes)¶
rate(http_requests_total[5m])
Memory usage for a specific device¶
bigip_memory_used_bytes{device="my-bigip-01"}
Discover all available metric names¶
curl -u "admin:pass" \
"https://<f5-insight-host>/api/metrics_proxy/api/v1/label/__name__/values"
Error responses¶
| Scenario | HTTP status | Response body |
|---|---|---|
Using http:// instead of https:// |
301 |
Moved Permanently – Switch to https:// |
Missing Authorization header |
401 |
{"status":"error","error":"Missing Authorization header"} |
| Wrong credentials | 401 |
{"status":"error","error":"Invalid username or password"} |
| TSDB backend unreachable | 502 |
{"status":"error","error":"Failed to connect to metrics backend","errorType":"proxy_error"} |
Configuration reference¶
The TSDB backend URL can be overridden using environment variables.
| Environment variable | Description | Default |
|---|---|---|
PROMETHEUS_URL |
TSDB backend URL (K8s/Helm deployments) |
|
BACKEND_PORT |
F5 Insight backend listen port | 6003 |
Connecting external Grafana¶
Note
If you have your own dashboard or tooling, the sections above are all you need. This section covers the specific steps to connect a Grafana instance using the proxy as a Prometheus data source.
Open Grafana and navigate to .
Select Prometheus.
Set URL to:
https://<f5-insight-host>/api/metrics_proxy
Note
Do not include
/api/v1in the URL. Grafana appends the versioned path automatically.Under Auth, enable Basic auth.
Enter your F5 Insight username and password.
Select Save & Test. You should see the message: “Successfully queried the Prometheus API”.
Grafana data source config (provisioning YAML)¶
apiVersion: 1
datasources:
- name: F5 Insight Metrics
type: prometheus
url: https://f5-insight.example.com/api/metrics_proxy
basicAuth: true
basicAuthUser: <username>
secureJsonData:
basicAuthPassword: <password>
isDefault: true