Skip to content

Commit

Permalink
chore: add requirement note about running instrumented code
Browse files Browse the repository at this point in the history
  • Loading branch information
nilslice authored Dec 13, 2023
1 parent 670d25f commit 790c9af
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion demo-iota/js/node/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ app.post('/run', bodyParser.raw({ limit: '256mb', type: () => true }), async (re
stdout,
env,
})

// NOTE: The wasm code loaded here will only report any metrics via the adapter _if the code is instrumented_.
// If you expect to see telemetry data, please be sure you're running instrumented code.
// This section of the docs is a good place to start:
// https://dev.dylibso.com/docs/observe/overview#2-instrumenting-your-code-automatic-or-manual
const bytes = fs.readFileSync(`${os.tmpdir()}/${req.query['name']}.wasm`)
const traceContext = await adapter.start(bytes)
const module = new WebAssembly.Module(bytes)
Expand All @@ -85,4 +90,4 @@ app.post('/run', bodyParser.raw({ limit: '256mb', type: () => true }), async (re
const port = 3000
app.listen(port, () => {
console.log(`Listening on port ${port}`)
})
})

0 comments on commit 790c9af

Please sign in to comment.