Jakob Ackermann 6a0388ff9b Merge pull request #4689 from overleaf/jpa-libraries-ci пре 5 година
..
.circleci 2f35db4087 Fix startup crash пре 6 година
test 6a0388ff9b Merge pull request #4689 from overleaf/jpa-libraries-ci пре 5 година
.eslintrc 971a768c4e Install prettier and eslint пре 6 година
.gitignore 23efa1d977 [misc] prepare for monorepo пре 5 година
.npmignore 0fdbb2dcc0 Add .npmignore to avoid publishing config files пре 6 година
.prettierrc 971a768c4e Install prettier and eslint пре 6 година
LICENSE 60857982b6 Create LICENSE пре 12 година
README.md acef9e7d8d Add basic README пре 5 година
buildscript.txt 6a0388ff9b Merge pull request #4689 from overleaf/jpa-libraries-ci пре 5 година
event_loop.js 971a768c4e Install prettier and eslint пре 6 година
http.js 8dcbd5aec0 Add support for the swagger-tools router пре 5 година
index.js 29742d6a87 [misc] register the metrics sweeping interval handle for later cleanup пре 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 e1650616b8 [misc] version bump to 3.5.1 пре 5 година
package.json 6a0388ff9b Merge pull request #4689 from overleaf/jpa-libraries-ci пре 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('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