appsignal

Adding Redis & MySQL to AppSignal for Node.js with OpenTelemetry

Tom de Bruijn

Tom de Bruijn on

Adding Redis & MySQL to AppSignal for Node.js with OpenTelemetry

We've simultaneously launched 4 new integrations for Node.js: Redis, ioredis, MySQL, and MySQL2. This means that you can now see all the details of a query in the Event Timeline and Slow Query screens in AppSignal.

Because we are a small and bootstrapped team, we've chosen to embrace OpenTelemetry as a means of expanding AppSignal's offering in the Node.js ecosystem.

Instrumentation for MySQL and Redis

With today's release, you'll get instrumentation for MySQL, MySQL2, Redis, and ioredis. That means that, in an event timeline, for example, you'll be able to see where performance is lagging the most.

And in the slow queries screen, you'll be able to see the queries that need the most attention.

Article Illustration

Much Wider Support Coming Through OpenTelemetry

Over the years, we've kept an eye on the OpenTelemetry project, even before it was called that. OpenTelemetry is a community project that aims to provide instrumentation for various languages and the libraries within their ecosystems.

Every APM vendor building their integrations from scratch, maintaining their own libraries, while ensuring they don't conflict with one another is a lot of work. It's better if everyone collaborated on the same base integrations to provide instrumentation. By collaborating, we'll all make the instrumentation better and provide better insights for all the different libraries out there.

OpenTelemetry integrations consist of multiple components (tracing, metrics, and logs) and they are a work in progress for most languages. The tracing component is stable for a lot of languages. That means that, since we've been keeping an eye on it, we think it is now in a good shape to use with AppSignal. The tracing component is the first part that we want to integrate with for our Node.js integration, to provide error reporting and performance measurements.

AppSignal OpenTelemetry Support

Our Node.js integration is the most recent of our integrations and we will provide better monitoring for you by integrating with OpenTelemetry, rather than build new integrations from scratch for the most used libraries out there.

We've created an OpenTelemetry processor as a way of transforming OpenTelemetry traces to AppSignal trace data. We'll be adding support for libraries a few at a time as we add compatibility for more OpenTelemetry features.

This first release will support performance monitoring for the following libraries through OpenTelemetry:

Please note that it's not possible to track any other OpenTelemetry events from other libraries in AppSignal at this time.

Instrumenting with OpenTelemetry

To instrument your app with OpenTelemetry and report the data to AppSignal, please follow our new installation instructions for OpenTelemetry in our docs. Make sure to check out the linked instructions for additional packages in the installation instructions.

If you've already set up AppSignal and OpenTelemetry in your project, it should be a matter of adding the AppSignal SpanProcessor to your tracer.

// tracing.js
const { Appsignal, SpanProcessor } = require("@appsignal/nodejs");
 
// Configure AppSignal
const appsignal = new Appsignal({
  active: true,
  // Any other AppSignal config for the app
});
 
const tracer = new NodeTracerProvider();
// Configure OpenTelemetry to use the AppSignal SpanProcessor.
// This will transform the OpenTelemetry trace data to AppSignal trace data.
tracer.addSpanProcessor(new SpanProcessor(appsignal));
tracer.register();

For further instrumentation, check out:

More Coming Soon…

Let us know if you are interested in more development around OpenTelemetry at AppSignal! The team is always excited to talk to people about how they're instrumenting their apps and to help out with any issues you run into.

Share this article

RSS
Tom de Bruijn

Tom de Bruijn

Tom is a developer at AppSignal, organizer, and writer from Amsterdam, The Netherlands.

-> All articles by Tom de Bruijn-> Become an AppSignal author

AppSignal monitors your apps

AppSignal provides insights for Ruby, Rails, Elixir, Phoenix, Node.js, Express and many other frameworks and libraries. We are located in beautiful Amsterdam. We love stroopwafels. If you do too, let us know. We might send you some!

Discover AppSignal
AppSignal monitors your apps