Christopher Hoskin acef9e7d8d Add basic README 5 ani în urmă
..
.circleci 2f35db4087 Fix startup crash 6 ani în urmă
test 2d1c84ea2e [misc] fix collection of open sockets 6 ani în urmă
.eslintrc 971a768c4e Install prettier and eslint 6 ani în urmă
.gitignore a0f856cff2 fix tests 6 ani în urmă
.npmignore 0fdbb2dcc0 Add .npmignore to avoid publishing config files 6 ani în urmă
.nvmrc fedc3191b8 Bump node to 10.19 6 ani în urmă
.prettierrc 971a768c4e Install prettier and eslint 6 ani în urmă
LICENSE 60857982b6 Create LICENSE 12 ani în urmă
README.md acef9e7d8d Add basic README 5 ani în urmă
event_loop.js 971a768c4e Install prettier and eslint 6 ani în urmă
http.js 8dcbd5aec0 Add support for the swagger-tools router 5 ani în urmă
index.js 29742d6a87 [misc] register the metrics sweeping interval handle for later cleanup 5 ani în urmă
memory.js 971a768c4e Install prettier and eslint 6 ani în urmă
mongodb.js 971a768c4e Install prettier and eslint 6 ani în urmă
open_sockets.js 2d1c84ea2e [misc] fix collection of open sockets 6 ani în urmă
package-lock.json e1650616b8 [misc] version bump to 3.5.1 5 ani în urmă
package.json e1650616b8 [misc] version bump to 3.5.1 5 ani în urmă
prom_wrapper.js 20223d865f [misc] do not register a noop sweeping interval 5 ani în urmă
timeAsyncMethod.js 971a768c4e Install prettier and eslint 6 ani în urmă
uv_threadpool_size.js 971a768c4e Install prettier and eslint 6 ani în urmă

README.md

overleaf/metrics-module

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 Cloud
  • ENABLE_DEBUG_AGENT - enables @google-cloud/debug-agent on Google Cloud
  • ENABLE_PROFILE_AGENT - enables @google-cloud/profiler on Google Cloud
  • METRICS_COMPRESSION_LEVEL - sets the compression level for /metrics
  • STACKDRIVER_LOGGING - toggles the request logging format
  • UV_THREADPOOL_SIZE - sets the libuv thread pool size