feat(metrics): integrate prom-client for native Prometheus support

- Add prom-client ^15.1.3 as production dependency
- Migrate Counter class to use prom-client internally
- Migrate Gauge class to use prom-client internally
- Migrate Histogram class to use prom-client internally
- Update getMetricsOutput() to use prom-client's native metrics()
- Update contentType() to use prom-client's contentType
- Enable collectDefaultMetrics() for Node.js system metrics
- Maintain backward compatibility with existing API

Benefits:
- Native OpenMetrics format export
- Proper histogram bucket handling
- Default Node.js metrics (memory, CPU, event loop, GC)
- Better integration with Grafana/Prometheus ecosystem
This commit is contained in:
Claude
2026-01-20 12:01:10 +00:00
parent e605a02528
commit 43ece09fe9
4 changed files with 213 additions and 102 deletions
+1
View File
@@ -49,6 +49,7 @@
"music-metadata": "^11.7.0",
"p-queue": "^9.0.0",
"pino": "^9.6",
"prom-client": "^15.1.3",
"protobufjs": "^7.2.4",
"ws": "^8.13.0"
},