Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@ bin
.aws-sam
out.txt

hello-world
!hello-world/main.go
examples/go
!examples/go/main.go

node_modules
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ You can run the extension in dev mode. It will not register the extension.

It's useful to test the relay server initialization.
Keep in mind there's no lambda execution, therefore to test data is being relayed correctly you need
to ingest manually.
to ingest manually (hitting `http://localhost:4040/ingest`).

`PYROSCOPE_DEV_MODE=true go run main.go`

Expand Down Expand Up @@ -92,3 +92,8 @@ aws lambda publish-layer-version \
--region=$YOUR_REGION \
--zip-file "fileb://extension.zip"
```

# Publishing
```
deno run --allow-env --allow-read --allow-run scripts/publish.ts --name=pyroscope-extension --dry-run=false
```
File renamed without changes.
1 change: 1 addition & 0 deletions examples/nodejs/.tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodejs 16.16.0
30 changes: 30 additions & 0 deletions examples/nodejs/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
const Pyroscope = require("@pyroscope/nodejs");

Pyroscope.init({
serverAddress: "http://localhost:4040",
appName: "my-node-service",
});
Pyroscope.start();

function doWork(number) {
for (let i = 0; i < number; i++) {}
}

exports.handler = async (event, context) => {
try {
response = {
"statusCode": 200,
"body": JSON.stringify({
message: "hello world",
}),
};
} catch (err) {
console.log(err);
return err;
}

doWork(99999999);
doWork(99999999);

return response;
};
Loading