Jakob Ackermann 2261e761f4 Merge pull request #5705 from overleaf/jpa-node-14 hace 4 años
..
.circleci 2f35db4087 Fix startup crash hace 6 años
test 6a0388ff9b Merge pull request #4689 from overleaf/jpa-libraries-ci hace 5 años
.dockerignore 8945373715 Merge pull request #5724 from overleaf/jpa-lean-docker-build hace 4 años
.eslintrc 971a768c4e Install prettier and eslint hace 6 años
.gitignore 23efa1d977 [misc] prepare for monorepo hace 5 años
.npmignore 0fdbb2dcc0 Add .npmignore to avoid publishing config files hace 6 años
.nvmrc 2261e761f4 Merge pull request #5705 from overleaf/jpa-node-14 hace 4 años
.prettierrc 971a768c4e Install prettier and eslint hace 6 años
CHANGELOG.md c5778fdd05 Merge pull request #5488 from overleaf/em-refactor-logger hace 5 años
LICENSE 60857982b6 Create LICENSE hace 12 años
README.md d9d65ac31c Merge pull request #5246 from overleaf/bg-upgrade-logger-in-all-libraries hace 5 años
buildscript.txt 2261e761f4 Merge pull request #5705 from overleaf/jpa-node-14 hace 4 años
event_loop.js 971a768c4e Install prettier and eslint hace 6 años
http.js c5778fdd05 Merge pull request #5488 from overleaf/em-refactor-logger hace 5 años
index.js c5778fdd05 Merge pull request #5488 from overleaf/em-refactor-logger hace 5 años
memory.js 971a768c4e Install prettier and eslint hace 6 años
mongodb.js 971a768c4e Install prettier and eslint hace 6 años
open_sockets.js 2d1c84ea2e [misc] fix collection of open sockets hace 6 años
package-lock.json c5778fdd05 Merge pull request #5488 from overleaf/em-refactor-logger hace 5 años
package.json c5778fdd05 Merge pull request #5488 from overleaf/em-refactor-logger hace 5 años
prom_wrapper.js 20223d865f [misc] do not register a noop sweeping interval hace 5 años
timeAsyncMethod.js 971a768c4e Install prettier and eslint hace 6 años
uv_threadpool_size.js 971a768c4e Install prettier and eslint hace 6 años

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('@overleaf/logger')
...
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