Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
@sentry/tracing
Advanced tools
The @sentry/tracing package provides performance monitoring and distributed tracing for applications. It allows developers to track the performance of their applications, understand latency issues, and monitor the flow of requests through various services in a distributed system.
Automatic Instrumentation
Automatically instruments the application to collect performance data. This includes capturing data for outgoing HTTP requests when using the Sentry.Integrations.Http integration.
const Sentry = require('@sentry/node');
const Tracing = require('@sentry/tracing');
Sentry.init({
dsn: 'YOUR_DSN',
tracesSampleRate: 1.0,
integrations: [new Sentry.Integrations.Http({ tracing: true })],
});
Manual Instrumentation
Allows developers to manually create transactions to trace specific operations or workflows within their application.
const transaction = Sentry.startTransaction({
op: 'test',
name: 'My Transaction',
});
// ... your code here ...
transaction.finish();
Performance Monitoring
Integrates with web frameworks like Express to provide performance monitoring for web applications. This includes automatic tracing of requests and responses.
const express = require('express');
const app = express();
const Sentry = require('@sentry/node');
const Tracing = require('@sentry/tracing');
Sentry.init({
dsn: 'YOUR_DSN',
integrations: [
new Sentry.Integrations.Http({ tracing: true }),
new Tracing.Integrations.Express({ app }),
],
tracesSampleRate: 1.0,
});
app.use(Sentry.Handlers.requestHandler());
app.use(Sentry.Handlers.tracingHandler());
// All controllers should live here
app.use(Sentry.Handlers.errorHandler());
app.listen(3000);
Distributed Tracing
Supports distributed tracing by allowing services to pass trace context in HTTP headers, enabling the tracking of requests across service boundaries.
const transaction = Sentry.startTransaction({
op: 'http',
name: 'My HTTP Request',
});
fetch('https://example.com', {
method: 'GET',
headers: {
'Sentry-Trace': transaction.toTraceparent(),
},
})
.then(response => {
// ... process the response ...
})
.finally(() => {
transaction.finish();
});
Zipkin is a distributed tracing system that helps gather timing data needed to troubleshoot latency problems in service architectures. It has features similar to @sentry/tracing but focuses more on the tracing aspect and less on error tracking and performance monitoring.
Jaeger, inspired by Dapper and OpenZipkin, is a distributed tracing system released as open source by Uber Technologies. Like @sentry/tracing, it provides monitoring and troubleshooting of microservices-based distributed systems, including distributed context propagation and transaction monitoring.
Datadog's APM tracing client for Node.js, dd-trace, provides distributed tracing and performance monitoring. It is similar to @sentry/tracing but is tailored to integrate with Datadog's suite of observability tools.
New Relic's APM tool offers application performance monitoring, including transaction tracing. It provides a full-stack observability solution, which includes features for monitoring application health, user experience, and network performance, in addition to distributed tracing.
This package contains extensions to the @sentry/hub
to enable Sentry AM related functionality. It also provides integrations for Browser and Node that provide a good experience out of the box.
The @sentry/tracing
package is the replacement to the @sentry/apm
package. No functionality has changed between
the packages, but there are some steps required for upgrade.
First, you must update your imports from the Tracing
integration to the BrowserTracing
integration.
import * as Sentry from "@sentry/browser";
import { Integrations } from "@sentry/tracing";
Sentry.init({
integrations: [
new Integrations.BrowserTracing({}),
]
})
Next, if you were using the beforeNavigate
option, the API has changed to this type:
/**
* beforeNavigate is called before a pageload/navigation transaction is created and allows for users
* to set a custom transaction context.
*
* If undefined is returned, a pageload/navigation transaction will not be created.
*/
beforeNavigate(context: TransactionContext): TransactionContext | undefined;
We removed the location argument, in favour of being able to see what the transaction context is on creation. You will
have to access window.location
yourself if you want to replicate that. In addition, if you return undefined in
beforeNavigate
, the transaction will not be created.
import * as Sentry from "@sentry/browser";
import { Integrations } from "@sentry/tracing";
Sentry.init({
integrations: [
new Integrations.BrowserTracing({
beforeNavigate: (ctx) => {
return {
...ctx,
name: getTransactionName(ctx.name, window.location)
}
}
}),
]
})
FAQs
Sentry Performance Monitoring Package
The npm package @sentry/tracing receives a total of 1,854,837 weekly downloads. As such, @sentry/tracing popularity was classified as popular.
We found that @sentry/tracing 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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.