Live Debugging

Dynamic Observability meets OpenTelemetry

Perfect duo for monitoring and debugging complex backend applications
Mehmet Yildiz
4 mins read
Sidekick's agent supports OpenTelemetry tracing, giving users even more visibility into their applications’ performance and helping them quickly identify and solve issues.

By combining Jaeger, OpenTelemetry tracing, and Sidekick Live Application Debugger, users can bring dynamic observability into their complex backend applications. This powerful combination gives them the visibility and information they need to understand, debug, and make the most of their applications.

When you enable distributed tracing with Sidekick, tracepoint snapshot events will be correlated to active traces at the time of tracepoint snapshot has been taken. So you will be able to go to the tracepoint snapshot event's related traces to understand what happened in the system during the execution of the overall flow/transaction. This article will show an example of using Sidekick with Jaeger & OpenTelemetry.

Some potential use cases for using tracing and Sidekick's agent together include:

  • Developer onboarding: When new developers join a team, they can use OpenTelemetry, and Sidekick to quickly understand the architecture and behavior of the application they are working on. This can help them to identify any potential issues and get up to speed quickly.
  • Observing event-driven microservices: By using OpenTelemetry, and Sidekick together, users can easily monitor and debug their event-driven microservices, providing them with the visibility they need to ensure that these services are running smoothly and performing as expected.
  • Debugging performance issues: When performance issues arise, users can use Open Telemetry and Sidekick to quickly identify the root cause of the problem and take action to fix it. This can help to optimize the application's performance and ensure that it is running smoothly.

Below I have prepared a sample to show how easy it is to integrate Sidekick with the OpenTelemetry agent & Jaeger.

Pre-Requirements

Before you start, ensure that the following tools are installed.

Installation

Step 1: Clone Project

I’ve prepared a Node.js project for this story. First, fork & clone the project from GitHub.

 git clone https://github.com/mehmetyz-test/opentelemetry-node-sidekick-example.git

Step 2: Installation

Install NPM dependencies for the project.


cd ./node
npm install

#then return top folder
cd ..

Step 3: Set Environment Variables

Next, ensure the following environment variables are set correctly for the project, and the Sidekick tool works correctly. You can either EXPORT those variables or create a .env file. Check docs for more info.


SIDEKICK_APIKEY= # get one from app.runsidekick.com
SIDEKICK_APPLICATION_NAME= #e.g. my-application 
SIDEKICK_APPLICATION_STAGE= # e.g. dev, prod ... etc.
SIDEKICK_APPLICATION_VERSION= # e.g. 1.0.0
SIDEKICK_AGENT_SCRIPT_PREFIX="./node" # project main folder

NODE_OPTIONS="-r @runsidekick/sidekick-agent-nodejs/dist/bootstrap"

Step 4: Setting up Resources

Then, create the resources used in the project using Docker. In the top folder of the repository, please run docker-compose command:

docker compose up

Step 5: Run the Project

Finally, run the application with the following commands:


cd ./node
npm run start

After running the application, you should see a screen like the one below:

Terminal Run the Project

Debugging with Sidekick

Go to the Sidekick Web app and log in to your account. (Every account starts with a 14days trial) Next, you should connect your application and add tracepoints as shown below.

Install the Application on Sidekick

Ok, everything looks good. After that, let’s send a request to an endpoint in the application in a browser.

http://localhost:3000/todo/1

The application will give us a response like this:

Response of the endpoint

Traces on Sidekick

If you go back to the Sidekick Web application, you will see tracepoints invoked within the application.

Trace Events from Sidekick Web

See the traces on Jaeger

Then, let’s see traces within the Jaeger UI. Firstly, open Jaeger UI on the browser:

http://localhost:16686/

Then select todo-service in the Service section. Next, choose the first trace on the list.

Traces on Jaeger UI

Now you can use trace-ids listed next to collected trace events in Sidekick events to learn more about them by typing them in the Jaeger UI. Allowing you to see the entire story behind any issues that may arise, giving them the information they need to fix the problem quickly and efficiently.

In conclusion, OpenTelemetry tracing and Sidekick are a powerful duo for monitoring and debugging complex backend applications.

These tools can help users lower their monitoring costs and quickly identify and solve issues, ensuring that their applications run smoothly and perform at their best. For more information, please visit https://runsidekick.com

Fresh insights from Sidekick experts every week.

Get the best insights, delivered straight to your inbox.