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

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