Product
Socket Now Supports uv.lock Files
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
@sentry/node-experimental
Advanced tools
Experimental version of a Node SDK using OpenTelemetry for performance instrumentation
This is a WIP, proof of concept implementation of a Node SDK that uses OpenTelemetry for performance instrumentation under the hood.
THIS MAY/WILL BREAK IN MANY UNEXPECTED WAYS. We may remove, add, change any of the integrations, add/remove any exports, etc. This package is NOT READY TO USE IN ANY FORM OF PRODUCTION ENVIRONMENT!
This SDK is considered experimental and in an alpha state. It may experience breaking changes, and may be discontinued at any time. Please reach out on GitHub if you have any feedback/concerns.
npm install @sentry/node-experimental
# Or yarn
yarn add @sentry/node-experimental
// CJS Syntax
const Sentry = require('@sentry/node-experimental');
// ESM Syntax
import * as Sentry from '@sentry/node-experimental';
Sentry.init({
dsn: '__DSN__',
// ...
});
Note that it is necessary to initialize Sentry before you import any package that may be instrumented by us.
Currently, this SDK:
You can manual instrument using the following APIs:
const Sentry = require('@sentry/node-experimental');
Sentry.startActiveSpan({ description: 'outer' }, function (span) {
span.setData(customData);
doSomethingSlow();
Sentry.startActiveSpan({ description: 'inner' }, function() {
// inner span is a child of outer span
doSomethingVerySlow();
// inner span is auto-ended when this callback ends
});
// outer span is auto-ended when this callback ends
});
You can also create spans without marking them as the active span.
Note that for most scenarios, we recommend the startActiveSpan
syntax.
const Sentry = require('@sentry/node-experimental');
// This will _not_ be put on the scope/set as active, so no other spans will be attached to it
const span = Sentry.startSpan({ description: 'non-active span' });
doSomethingSlow();
span?.finish();
Finally you can also get the currently active span, if you need to do more with it:
const Sentry = require('@sentry/node-experimental');
const span = Sentry.getActiveSpan();
We leverage the OpenTelemetry context forking in order to ensure isolation of parallel requests.
This means that as long as you are using an OpenTelemetry instrumentation for your framework of choice
(currently: Express or Fastify), you do not need to setup any requestHandler
or similar.
Due to the way OpenTelemetry handles instrumentation, this only works out of the box for CommonJS (require
) applications.
There is experimental support for running OpenTelemetry with ESM ("type": "module"
):
node --experimental-loader=@opentelemetry/instrumentation/hook.mjs ./app.js
See OpenTelemetry Instrumentation Docs for details on this - but note that this is a) experimental, and b) does not work with all integrations.
All of these are auto-discovered, you don't need to configure anything for performance.
You still need to register middlewares etc. for error capturing.
Other, non-performance integrations from @sentry/node
are also available (except for Undici).
FAQs
Experimental version of a Node SDK using OpenTelemetry for performance instrumentation
The npm package @sentry/node-experimental receives a total of 32 weekly downloads. As such, @sentry/node-experimental popularity was classified as not popular.
We found that @sentry/node-experimental demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 11 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.