Nodejs agent for Sidekick open-source live application debugger

Overview

Sidekick Agent NodeJS

Sidekick agent Nodejs is a Nodejs library that communicate with Sidekick broker to inspect, monitor and debug your application on the fly.

Installation

npm install @runsidekick/sidekick-agent-nodejs

There are two way to integrate Sidekick agent to your application.

Integrate Agent with Environment Variable

You can easily integrate Sidekick using below environment variables.

  • set SIDEKICK_APIKEY environment variable with your Sidekick api key.
  • set NODE_OPTIONS environment variable with '-r @runsidekick/sidekick-agent-nodejs/dist/bootstrap'

Integrate Agent with Code

You can easily integrate Sidekick adding below code block to top of your project.

JS example

const SidekickDebugger = require('@runsidekick/sidekick-agent-nodejs');

SidekickDebugger.start({ 
    apiKey: '<Your_Api_Key>'
});

...

TS example

import * as SidekickDebugger from '@runsidekick/sidekick-agent-nodejs';

SidekickDebugger.start({ 
    apiKey: '<Your_Api_Key>'
});

...

Configs

Config Requirement Environment Variable Default
apiKey Required SIDEKICK_APIKEY None
logLevel Optional SIDEKICK_AGENT_LOG_LEVEL info
disable Optional SIDEKICK_AGENT_DISABLE false
brokerHost Optional SIDEKICK_AGENT_BROKER_HOST Sidekick broker address
brokerPort Optional SIDEKICK_AGENT_BROKER_PORT Sidekick broker port
brokerClient Optional SIDEKICK_AGENT_BROKER_CLIENT Logged in user
applicationId Optional SIDEKICK_AGENT_APPLICATION_ID Generated by agent
applicationName Optional SIDEKICK_AGENT_APPLICATION_NAME Empty string
applicationInstanceId Optional SIDEKICK_AGENT_APPLICATION_INSTANCE_ID Generated by agent
applicationVersion Optional SIDEKICK_AGENT_APPLICATION_VERSION Empty string
applicationStage Optional SIDEKICK_AGENT_APPLICATION_STAGE Empty string
applicationTag Optional SIDEKICK_AGENT_APPLICATION_TAG None
maxFrames Optional SIDEKICK_AGENT_MAX_FRAMES 20
maxExpandFrames Optional SIDEKICK_AGENT_MAX_EXPAND_FRAMES 1
maxProperties Optional SIDEKICK_AGENT_MAX_PROPERTIES 10
maxParseDepth Optional SIDEKICK_AGENT_MAX_PARSE_DEPTH 3
propertyAccessClassification Optional SIDEKICK_AGENT_PROPERTY_ACCESS_CLASSIFICATION ENUMERABLE-OWN
scriptPrefix Optional SIDEKICK_AGENT_SCRIPT_PREFIX None
rejectOnStartup Optional SIDEKICK_AGENT_REJECT_ON_STARTUP false
captureFrameDataReductionCallback Optional None
logMessageDataReductionCallback Optional None
errorCollectionEnable Optional SIDEKICK_AGENT_ERROR_COLLECTION_ENABLE false
errorCollectionEnableCaptureFrame Optional SIDEKICK_AGENT_ERROR_COLLECTION_CAPTURE_FRAME false

Valid Config Values

  • propertyAccessClassification (SIDEKICK_AGENT_PROPERTY_ACCESS_CLASSIFICATION) configuration can take one of following values:
    • ENUMERABLE-OWN (default value)
    • ENUMERABLE-OWN-AND-ENUMERABLE-PARENT
    • ENUMERABLE-OWN-AND-NON-ENUMERABLE-OWN
    • ENUMERABLE-OWN-AND-NON-ENUMERABLE-OWN-ENUMERABLE-PARENT
Comments
  • Tracepoints Don't Work

    Tracepoints Don't Work

    I installed sidekick on my Node.js application, and set up the VSCode extension (not using the cloud IDE, full read access to all public and private repositories that I own without any way of restricting the repositories that you have access to is a hard no).

    Following the docs, I added a LogPoint, which worked fine, but when I added a TracePoint, I see that it never arrives in the Trace Events table. I turned on Debug logs, and whenever the tracepoint tries to send an event, it fails with the following error:

    debug <TracePointAction> An error occured while resolving frames Converting circular structure to JSON
    debug     --> starting at object with constructor 'Socket'
    debug     |     property 'parser' -> object with constructor 'HTTPParser'
    debug     --- property 'socket' closes the circle
    debug <CommunicationManager> Sending data to communication api.
    debug <TracePointAction> Tracepoint probe action working ...
    debug <DefaultDebugApi> Script information can not be empty.
    

    This fails consistently on all TracePoints I try to add.

    bug 
    opened by probably-not 29
  • Logs Exploding with 502 errors

    Logs Exploding with 502 errors

    Starting in the last few days, my logs have exploded with the following error:

    ERR! <CommunicationApiListener> An error occured on socket connection: Unexpected server response: 502 undefined
    

    This error happens every 5 seconds.

    I can't tell exactly when it started since it has been happening so much that it has caused older logs to be deleted (our log storage rolls based on storage space).

    bug 
    opened by probably-not 5
  • Agent Connection Issue With Broker Does Not Retry

    Agent Connection Issue With Broker Does Not Retry

    When the Agent has a connection issue with the broker in startup, there is no retry on the connection, so we cannot debug the application without restarting the app.

    bug 
    opened by probably-not 5
  • VSCode Sidekick Plugin Tracepoint Events and Logpoint Event Does Not Refresh themselves Automatically

    VSCode Sidekick Plugin Tracepoint Events and Logpoint Event Does Not Refresh themselves Automatically

    VSCode Sidekick Plugin tabs (SIDEKICK: TRACE EVENTS & SIDEKICK: LOG EVENTS) can be update themselves automatically when new tracepoint and logpoint events produced.

    bug 
    opened by bcaglayan 4
  • [Security] - GitHub App Permissions

    [Security] - GitHub App Permissions

    Currently, Sidekick is requesting Full Permissions for read and write to all private and public repositories, and on top of that, is requesting Full Permissions for read and write to all personal information.

    image

    This is a hard no in terms of security, and under no circumstances should Sidekick have full read and write permissions on Personal information data.

    In addition to the issue of requesting full permissions to personal information, it's a major security issue to request write permissions on all public and private repositories, especially when this can't be scoped to a specific repository under a specific organization.

    enhancement 
    opened by probably-not 3
  • VSCode Sidekick Plugin LogPoint Encoding And Visualization Issues

    VSCode Sidekick Plugin LogPoint Encoding And Visualization Issues

    I've added a LogPoint on a line that contains an exception (See #2 for the code example). The LogPoint logExpression is defined as {{exception.stack}}, which will output the exception stack for us to trace back to the original exception point.

    The current output looks like this:

    UnauthorizedException: Unauthorized at MixinAuthGuard.handleRequest (&#x2F;app&#x2F;node_modules&#x2F;@nestjs&#x2F;passport&#x2F;dist&#x2F;auth.guard.js:68:30) at &#x2F;app&#x2F;node_modules&#x2F;@nestjs&#x2F;passport&#x2F;dist&#x2F;auth.guard.js:49:128 at &#x2F;app&#x2F;node_modules&#x2F;@nestjs&#x2F;passport&#x2F;dist&#x2F;auth.guard.js:91:24 at allFailed (&#x2F;app&#x2F;node_modules&#x2F;passport&#x2F;lib&#x2F;middleware&#x2F;authenticate.js:110:18) at attempt (&#x2F;app&#x2F;node_modules&#x2F;passport&#x2F;lib&#x2F;middleware&#x2F;authenticate.js:183:28) at JwtStrategy.strategy.fail (&#x2F;app&#x2F;node_modules&#x2F;passport&#x2F;lib&#x2F;middleware&#x2F;authenticate.js:305:9) at JwtStrategy.authenticate (&#x2F;app&#x2F;node_modules&#x2F;passport-jwt&#x2F;lib&#x2F;strategy.js:96:21) at attempt (&#x2F;app&#x2F;node_modules&#x2F;passport&#x2F;lib&#x2F;middleware&#x2F;authenticate.js:369:16) at authenticate (&#x2F;app&#x2F;node_modules&#x2F;passport&#x2F;lib&#x2F;middleware&#x2F;authenticate.js:370:7) at &#x2F;app&#x2F;node_modules&#x2F;@nestjs&#x2F;passport&#x2F;dist&#x2F;auth.guard.js:96:3 at new Promise (&lt;anonymous&gt;) at &#x2F;app&#x2F;node_modules&#x2F;@nestjs&#x2F;passport&#x2F;dist&#x2F;auth.guard.js:88:83 at MixinAuthGuard.&lt;anonymous&gt; (&#x2F;app&#x2F;node_modules&#x2F;@nestjs&#x2F;passport&#x2F;dist&#x2F;auth.guard.js:49:36) at Generator.next (&lt;anonymous&gt;) at fulfilled (&#x2F;app&#x2F;node_modules&#x2F;@nestjs&#x2F;passport&#x2F;dist&#x2F;auth.guard.js:17:58) at runMicrotasks (&lt;anonymous&gt;) at processTicksAndRejections (node:internal&#x2F;process&#x2F;task_queues:96:5)
    

    It looks like there's an encoding (HTML encoding I think?) that's not being decoded properly in VSCode's visualization.

    This is what it should look like when I decode it manually:

    UnauthorizedException: Unauthorized at MixinAuthGuard.handleRequest (/app/node_modules/@nestjs/passport/dist/auth.guard.js:68:30) at /app/node_modules/@nestjs/passport/dist/auth.guard.js:49:128 at /app/node_modules/@nestjs/passport/dist/auth.guard.js:91:24 at allFailed (/app/node_modules/passport/lib/middleware/authenticate.js:110:18) at attempt (/app/node_modules/passport/lib/middleware/authenticate.js:183:28) at JwtStrategy.strategy.fail (/app/node_modules/passport/lib/middleware/authenticate.js:305:9) at JwtStrategy.authenticate (/app/node_modules/passport-jwt/lib/strategy.js:96:21) at attempt (/app/node_modules/passport/lib/middleware/authenticate.js:369:16) at authenticate (/app/node_modules/passport/lib/middleware/authenticate.js:370:7) at /app/node_modules/@nestjs/passport/dist/auth.guard.js:96:3 at new Promise (<anonymous>) at /app/node_modules/@nestjs/passport/dist/auth.guard.js:88:83 at MixinAuthGuard.<anonymous> (/app/node_modules/@nestjs/passport/dist/auth.guard.js:49:36) at Generator.next (<anonymous>) at fulfilled (/app/node_modules/@nestjs/passport/dist/auth.guard.js:17:58) at runMicrotasks (<anonymous>) at processTicksAndRejections (node:internal/process/task_queues:96:5)
    
    
    bug 
    opened by probably-not 3
  • VSCode - When `SIDEKICK_AGENT_MAX_EXPAND_FRAMES` is 1, Plugin still shows empty frames in the view

    VSCode - When `SIDEKICK_AGENT_MAX_EXPAND_FRAMES` is 1, Plugin still shows empty frames in the view

    I am getting 2 empty frames on the tracepoint: image

    Originally posted by @probably-not in https://github.com/runsidekick/sidekick-agent-nodejs/issues/2#issuecomment-1245015112

    enhancement 
    opened by probably-not 2
Owner
Sidekick
Troubleshoot problems where and when they happen, without stopping, rebuilding, or redeploying applications.
Sidekick
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
WIP: Hevm based debugger for hardhat-huff projects

Huff Debug An easy hevm debug integration for hardhat-huff projects What does it do: Speed up your development experience by gaining rich feedback in

Huff 6 Jul 15, 2022
A Front-End JavaScript Debugger

vDebugger · English | 简体中文 A Front-End JavaScript Breakpoint Debugger. Make it possible to debug your JavaScript in browser, Node.js, JavaScriptCore o

Wechat.js 6 Nov 8, 2022
LunaSec - Open Source Security Software built by Security Engineers. Scan your dependencies for Log4Shell, or add Data Tokenization to prevent data leaks. Try our live Tokenizer demo: https://app.lunasec.dev

Our Software We're a team of Security Engineers on a mission to make awesome Open Source Application Security tooling. It all lives in this repo. Here

LunaSec 1.2k Jan 7, 2023
This is a little script that shows how to ddos a website. Can bypass cloudfare & ddos-guard. Ip switcher and random user agent

This is a little script that shows how to ddos a website. Can bypass cloudfare & ddos-guard. Ip switcher and random user agent

null 13 Dec 17, 2022
A cloudflare worker to use the user-agent for ~~rickrolling~~ without a discord embed

nextcord.gay A cloudflare worker to use the user-agent for rickrolling without a discord embed Build npm run build Find the output in ./dist/worker.mj

Oliver Wilkes 10 Oct 4, 2022
A Multi-Agent Path Finding visualization website.

MAPF Visualizer A visualization tool for multi-agent path finding algorithms. About The Project This project provides a visualization tool for Multi-A

Yutong Li 22 Dec 29, 2022
UAParser.js - Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data. Supports browser & node.js environment.

UAParser.js JavaScript library to detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data with relatively small footprint (~17KB m

Faisal Salman 7.4k Jan 4, 2023
This repository demonstrates how to integrate your Dialogflow agent with 3rd-party services services using a Node.JS backend service

This repository demonstrates how to integrate your Dialogflow agent with 3rd-party services services using a Node.JS backend service. Integrating your service allows you to take actions based on end-user expressions and send dynamic responses back to the end-user.

ddayto 10 Jul 21, 2022
🦠🔬 Forta agent that detect deployment of smart contracts containing an exploit function

Attack Simulation Bot Description The agent detects deployment of smart contracts containing an exploit function. Using a simulation-based approach, t

Artem Kovalchuk 29 Dec 26, 2022
Your emergency buddy and agent.

S.H.I.E.L.D: To make you Beware of your surrounding The main aim of the S.H.I.E.L.D is to safeguard the individual and also make them aware about the

Prathik Shetty 6 Oct 2, 2022
Your emergency buddy and agent.

S.H.I.E.L.D: To make you Beware of your surrounding The main aim of the S.H.I.E.L.D is to safeguard the individual and also make them aware about the

Prathik Shetty 6 Oct 2, 2022
Front end for Agent-LLM.

Agent-LLM (Large Language Model), Front End Please use the outreach email for media, sponsorship, or to contact us for other miscellaneous purposes. D

Jameson Grieve 8 May 8, 2023
Reference for How to Write an Open Source JavaScript Library - https://egghead.io/series/how-to-write-an-open-source-javascript-library

Reference for How to Write an Open Source JavaScript Library The purpose of this document is to serve as a reference for: How to Write an Open Source

Sarbbottam Bandyopadhyay 175 Dec 24, 2022
An Open-Source Platform to certify open-source projects.

OC-Frontend This includes the frontend for Open-Certs. ?? After seeing so many open-source projects being monetized ?? without giving any recognition

Open Certs 15 Oct 23, 2022
Shikhar 4 Oct 9, 2022