Repository - API - Source
@opentelemetry/instrumentation-dns
from tracing to reduce number of useless tracesTRACING_MONGO_DISABLED
to optionally disable mongodb tracing@opentelemetry/instrumentation-net
from tracing to reduce number of useless tracesenv:
- name: OBSERVABILITY_SERVICE_NAME
value: "__SERVICE_NAME__"
- name: SENTRY_DSN
value: "__PUBLIC_DSN__"
// Before
const observability = require('@infrastructure/observability').init({
serviceName: '__SERVICE_NAME__', // DO NOT prefix by env
sentry: {
dsn: '__SENTRY_DSN__',
},
})
// After
const observability = require('@infrastructure/observability')
requires you to adjust the TRACING_URI from http://localhost:55681/v1/trace
to http://localhost:4318/v1/traces
when using collector 0.43.0
https://github.com/open-telemetry/opentelemetry-collector/blob/main/CHANGELOG.md#v0430-beta
Requires node:14.15
Supports node:16
addPreControllersMiddlewares
could crash the server under high loadSentry internally uses the domain feature of nodejs (deprecated). This is used to catch all errors in a context. These domains are kept inside a js map using a weak reference. If the number of requests increases strongly, something is garbage collecting these weak references before the code can add a reference to it. When it then tries to access it, it is referencing an undefined, which then has no .get.
See nodejs core issue https://github.com/nodejs/node/issues/30122
addPreControllersMiddlewares
: function to configure the handlers that have to be set before the controllers in an Express app (i.e. Sentry request and tracing handlers)addPostControllersMiddlewares
: function to configure the handlers that have to be set after the controllers in an Express app (i.e. Sentry error handler)observeServer(server, app)
becomes just observeServer(server)
: it doesn't add any handler to the Express application, hence it just accept server
as argument/-/ping
and /-/ping/
observability.tracing.currentRootSpan()
Added opencensus tracing. See README for details.
NODE_ENV=test
mode, allow for unit tests to be run with out manually doing hacksNODE_ENV=test
unhandledPromises
by clearing sentry's queue before exiterrorHandler
in monitoring.observeServer
monitoring.observeServer(server, app)
is called after any other express middleware is added it
throws an exceptionmonitoring.bindServer(server)
-> monitoring.observeServer(server, app)
tracer
propertymonitoring.observeServer(server, app)
liveness
and readiness
checks to return promises OR throw an Error to stopAdds more tests for metrics and monitoring