Christopher Hoskin 5f69488f67 Merge pull request #12369 from overleaf/csh-issue-4497-bump-profiler 3 yıl önce
..
.circleci 2f35db4087 Fix startup crash 6 yıl önce
test 74eeec2ba3 Merge pull request #11680 from overleaf/em-mongo-pool-monitoring 3 yıl önce
.dockerignore 8945373715 Merge pull request #5724 from overleaf/jpa-lean-docker-build 4 yıl önce
.gitignore 23efa1d977 [misc] prepare for monorepo 5 yıl önce
.npmignore 0fdbb2dcc0 Add .npmignore to avoid publishing config files 6 yıl önce
.nvmrc 51806703b7 Merge pull request #9819 from overleaf/bg-node-upgrade 4 yıl önce
CHANGELOG.md c94043e2fe Merge pull request #10144 from overleaf/ii-metrics-api-patch-opts-arg 4 yıl önce
LICENSE 60857982b6 Create LICENSE 12 yıl önce
README.md d9d65ac31c Merge pull request #5246 from overleaf/bg-upgrade-logger-in-all-libraries 5 yıl önce
buildscript.txt 51806703b7 Merge pull request #9819 from overleaf/bg-node-upgrade 4 yıl önce
event_loop.js 4b308553be Merge pull request #6120 from overleaf/jpa-same-linting-packages 4 yıl önce
http.js efcb06f0df Merge pull request #7905 from overleaf/em-request-logging 4 yıl önce
index.js 74eeec2ba3 Merge pull request #11680 from overleaf/em-mongo-pool-monitoring 3 yıl önce
memory.js e0d91eaa26 Merge pull request #7906 from overleaf/em-downgrade-logs 4 yıl önce
mongodb.js 74eeec2ba3 Merge pull request #11680 from overleaf/em-mongo-pool-monitoring 3 yıl önce
open_sockets.js 4b308553be Merge pull request #6120 from overleaf/jpa-same-linting-packages 4 yıl önce
package.json 5f69488f67 Merge pull request #12369 from overleaf/csh-issue-4497-bump-profiler 3 yıl önce
prom_wrapper.js 5683cebf71 Merge pull request #11679 from overleaf/em-upgrade-prom-client 3 yıl önce
timeAsyncMethod.js e0d91eaa26 Merge pull request #7906 from overleaf/em-downgrade-logs 4 yıl önce
tracing.js 50b346b4ed Merge pull request #10279 from overleaf/jpa-tracing-optimizations 3 yıl önce
uv_threadpool_size.js 4b308553be Merge pull request #6120 from overleaf/jpa-same-linting-packages 4 yıl önce

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