Add pkg/metrics/text, a small Prometheus text-format writer, and use it for frpc's /metrics. The endpoint lives only on metricsServer and is covered by its Basic Auth, like the other endpoints there. The package emits the Go runtime families and, on Linux, the process families read from /proc. Their names, types and help strings match client_golang's default collectors, so existing Go runtime dashboards keep working. It deliberately emits no frp_ business metrics and none of client_golang's promhttp_ handler metrics. Writing the subset ourselves keeps client_golang and protobuf out of the frpc binary; both are still used by frps and by the tests here.
1.2 KiB
Features
-
frpc can verify server certificates using system CAs, optionally combined with CAs from
trustedCaFile. -
frpc reloadnow refreshes certificate files for unchangedhttps2httpandhttps2httpsproxies without interrupting existing connections. Failed refreshes keep the previous certificate and report the error in proxy status and logs while reload still succeeds. -
Added
metricsServerto both frps and frpc, a separate listener for health checks, metrics and optional profiling that does not expose the dashboard or the admin API. It is disabled unlessmetricsServer.portis set, defaults to127.0.0.1, and has its own credentials and TLS. Setting the port serves/metricson both: frps exposes runtime and business metrics, soenablePrometheusis not needed there, and frpc exposes Go runtime metrics only, without linking an extra metrics library.The
/healthz,/metricsand pprof endpoints onwebServer, andenablePrometheus, still work but are deprecated: configuremetricsServerinstead. They will be removed in a later release.
Fixes
- Fixed proxy and visitor configuration changes being lost when reloading frpc during reconnection.