|
|
%!s(int64=5) %!d(string=hai) anos | |
|---|---|---|
| .. | ||
| .circleci | %!s(int64=5) %!d(string=hai) anos | |
| test | %!s(int64=5) %!d(string=hai) anos | |
| .eslintrc | %!s(int64=6) %!d(string=hai) anos | |
| .gitignore | %!s(int64=5) %!d(string=hai) anos | |
| .npmignore | %!s(int64=5) %!d(string=hai) anos | |
| .prettierrc | %!s(int64=6) %!d(string=hai) anos | |
| LICENSE | %!s(int64=12) %!d(string=hai) anos | |
| README.md | %!s(int64=5) %!d(string=hai) anos | |
| buildscript.txt | %!s(int64=5) %!d(string=hai) anos | |
| event_loop.js | %!s(int64=6) %!d(string=hai) anos | |
| http.js | %!s(int64=5) %!d(string=hai) anos | |
| index.js | %!s(int64=5) %!d(string=hai) anos | |
| memory.js | %!s(int64=6) %!d(string=hai) anos | |
| mongodb.js | %!s(int64=6) %!d(string=hai) anos | |
| open_sockets.js | %!s(int64=5) %!d(string=hai) anos | |
| package-lock.json | %!s(int64=5) %!d(string=hai) anos | |
| package.json | %!s(int64=5) %!d(string=hai) anos | |
| prom_wrapper.js | %!s(int64=5) %!d(string=hai) anos | |
| timeAsyncMethod.js | %!s(int64=6) %!d(string=hai) anos | |
| uv_threadpool_size.js | %!s(int64=6) %!d(string=hai) anos | |
Wrappers the prom-client npm module to provide Prometheus metrics at /metrics.
Use:
const metrics = require('@overleaf/metrics')
metrics.initialize('myapp')
const express = require('express')
const app = express()
metrics.injectMetricsRoute(app)
Request logging can be enabled:
const logger = require('logger-sharelatex')
...
app.use(metrics.http.monitor(logger))
The metrics module can be configured through the following environment variables:
DEBUG_METRICS - enables display of debugging messages to the console.ENABLE_TRACE_AGENT - enables @google-cloud/trace-agent on Google CloudENABLE_DEBUG_AGENT - enables @google-cloud/debug-agent on Google CloudENABLE_PROFILE_AGENT - enables @google-cloud/profiler on Google CloudMETRICS_COMPRESSION_LEVEL - sets the compression level for /metricsSTACKDRIVER_LOGGING - toggles the request logging formatUV_THREADPOOL_SIZE - sets the libuv thread pool size