Send your collected tracepoint & logpoint events to your Loki instances.
Explore the docs »
Sidekick Home
·
Report Bug & Request Feature
Table of Contents
Related blog post: https://medium.com/runsidekick/sidekick-recipes-2-add-missing-logs-to-your-running-microservices-and-send-them-to-loki-1f5a3449343c
Sidekick is a production debugging and on-demand logging tool where you can debug your running applications while they keep on running. Sidekick provides the ability to add logs and put non-breaking breakpoints in your application code which captures the snapshot of the application state, the call stack, variables, etc.
Sidekick Actions:
- A tracepoint is basically a non-breaking remote breakpoint. In short, it takes a snapshot of the variables when the code hits that line.
- Logpoints open the way for dynamic logging to Sidekick users. Replacing traditional logging with dynamic logging has the potential to lower stage sizes, costs, and time for log searching while adding the ability to add new logpoints without editing the source code, redeploying or restarting the application
This recipe aims to help you send your collected tracepoint & logpoint events to your own Loki instances.
tested with node v16.14.2
-
Clone the repo
git clone https://github.com/boroskoyo/sidekick-elastic.git
-
Install NPM packages
npm install
-
Create a
.env
file and edit according to your needssidekick_email: "" sidekick_password: "" loki_url: "" loki_auth: ""
-
Edit the ingestFunc function if yo want to alter your logs. You can also define different functions for tracepoints & logpoints.
function ingestFunc () { return async function (data) { logger.info(JSON.stringify(data)); } }
-
Run!
npm start
You can also run this recipe in a container. For this purpose a Dockerfile is located in the directory.
Barış Kaya - @boroskoyo
Sidekick: website