- Update opentelemetry-js monorepo to ^0.38.0
- Update various libraries
- Add typescript types
- Remove
@opentelemetry/instrumentation-dns
from tracing to reduce number of useless traces - Add
TRACING_MONGO_DISABLED
to optionally disable mongodb tracing
- Remove
@opentelemetry/instrumentation-net
from tracing to reduce number of useless traces
- Make Feature Flags optional and not crash by default.
- Fix issue with configuration that permanently disabled the feature flags
- Add node 18 support
- Update most dependencies to latest version
- Updates @sentry/node to v7
- Remove support for Mongo 4 and only support Mongo 5 and up
- Remove tracing for gitlab feature flags
- Initialize observability before package import
- Remove API support for sentry.beforeSend
- Set environment variables for initializing service. Following is the minimum configuration that is required (see https://gitlab.unueng.com/infrastructure/node-observability#env-settings for all env settings):
env:
- name: OBSERVABILITY_SERVICE_NAME
value: "__SERVICE_NAME__"
- name: SENTRY_DSN
value: "__PUBLIC_DSN__"
- Remove call to initialize observability in service
// 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')
- Update packages to latest minor versions
- Remove express from tracing by default
- Upgrade opentelemtry core libs
- Upgrade @sentry/node to 6.17.9
- Upgrade prom-client to 14.0.1
- Upgrade http-errors to 2.0.0
- Upgrade prom-client to 14.0.1
- Updgrade unleash-client to 3.12.0
-
requires you to adjust the TRACING_URI from
http://localhost:55681/v1/trace
tohttp://localhost:4318/v1/traces
when using collector0.43.0
https://github.com/open-telemetry/opentelemetry-collector/blob/main/CHANGELOG.md#v0430-beta -
Requires node:14.15
-
Supports node:16
- Remove AMQP url from publish traces
- Add recordException() to tracing, which enables recording exceptions
- Replaced Opencensus with OpenTelemtry
- Added the GitLab Feature Flags feature
- Fix a nodejs bug, where using
addPreControllersMiddlewares
could crash the server under high load
Sentry 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 nodejs/node#30122
- Fix Sentry error handler configuration: it now creates Sentry alerts for HTTP errors >500
- Add
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) - Add
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 justobserveServer(server)
: it doesn't add any handler to the Express application, hence it just acceptserver
as argument
- Update dependencies with vulnerabilities
- Fix tracing ignore regex to match both
/-/ping
and/-/ping/
- Add shortcut for getting current root span.
observability.tracing.currentRootSpan()
- Add short cut for adding observability.tracing.addRootSpanAttribute('tag', 'some tag content')
- Fix issue of observeServer using jaeger header instead of opencencus to retrieve trace id
- Using observeServer now parses trace ids in the Jaeger propagation format from requests and adds a "trace_id" tag to Sentry errors
- observeServer now supports multiple servers
- Added default attribute "environment" to all traces. Defaults to "development" and is overwritten by APP_ENV
- Ignoring multiple monitoring endpoints in tracing to not spam tracing. See README for details.
- Fix debug logs being enabled by default
- Add mongodb tracing to opencensus. See README for details.
- Bump sentry to 5.7.1 fixes https://npmjs.com/advisories/1184
Added opencensus tracing. See README for details.
- Only include index.js and lib/ in npm package
- Automatically init (with default values) when
NODE_ENV=test
mode, allow for unit tests to be run with out manually doing hacks - Do not start and bind internal monitoring server when
NODE_ENV=test
- Better handle
unhandledPromises
by clearing sentry's queue before exit - Automatically install Sentry's
errorHandler
inmonitoring.observeServer
- If
monitoring.observeServer(server, app)
is called after any other express middleware is added it throws an exception
- Rename
monitoring.bindServer(server)
->monitoring.observeServer(server, app)
- Remove tracing support for now! This means automatic tracing has been removed as well as
tracer
property
- Automatically install Sentry handler to express if you pass it into
monitoring.observeServer(server, app)
- Better shutdown handling
- Allow
liveness
andreadiness
checks to return promises OR throw an Error to stop
- Adds more tests
- Better docs and example
- Adds ability to put sentry in debug mode via SENTRY_DEBUG env flag
- Adds unhandled promise handler that prints the error and exits the app with status 1
- This is required because sentry installs its own unhandled promise handler which swallows the errors in dev mode. Also on an unhandled promise we * should rather exit. Chances are HIGH the application will be in an unusable state if this happens
- NA
Adds more tests for metrics and monitoring