examples/language-sdk-instrumentation/nodejs/express-pull/README.md
This example demonstrates how Pyroscope can be used to scrape pprof profiles from remote nodejs targets using Grafana Alloy.
Instead of the application pushing profiles to Pyroscope, Alloy periodically scrapes the pprof endpoints exposed by each nodejs instance and forwards the profiles to the Pyroscope server.
docker-compose up -d
As a sample application we use a slightly modified rideshare app, started in three regions (us-east, eu-north, ap-south). Each instance exposes pprof endpoints via the @pyroscope/nodejs express middleware.
The scrape configuration lives in alloy.config.alloy: Alloy scrapes each target and forwards the profiles to the Pyroscope write endpoint.
Profiling is more fun when the application does some work, so it ships with a built-in load generator.
Now that everything is set up, you can browse profiling data via the Pyroscope UI or the bundled Grafana instance. Alloy's own UI is available at http://localhost:12345.