-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make trace-events write to configurable sink #152
Comments
some overlap here w/ #163? |
I don’t think so. Trace Events is a provider for our UDTP (user defined tracking point) implementation. The other implementations will have their own sink mechanism (the kernel). PS: nodejs/node#18480 will land soon, so that will at least make it possible to write to an arbitrary file. |
Quick update on this: @ofrobots and I have been speaking about the possibility of using the inspector protocol to deliver trace events. Some work has already started in this direction with a PR to allow multiple concurrent inspector protocol sessions. There's a bit of work to do here but it should give us a number of solid options. |
Some updates from our side:
Once this is available, it would be fairly straightforward to write clients in JS, or otherwise, to connect and consume data. Here's a small program that I wrote that retrieves trace data. I tested this against Chrome – as node doesn't expose the Tracing domain through the inspector just yet. const CDP = require('chrome-remote-interface');
async function main() {
const client = await CDP();
client.on('event', (message) => {
console.log(message.method);
});
let result = await client.Tracing.start({ recordMode: 'recordContinuously', transferMode: 'ReturnAsStream'});
client.Tracing.tracingComplete(async (params) => {
const stream = params.stream;
let eof = false;
let num = 0;
while (!eof) {
const chunk = await client.IO.read({handle: stream, size: 128 * 1024});
num++;
console.log(`chunk ${num} eof:`, chunk.eof, 'data:', chunk.data.length);
eof = chunk.eof;
}
});
setTimeout(() => { client.Tracing.end(); }, 2000);
}
main().catch(console.error); |
Having this data over CDP is really useful, but does it obviate desire to redirect trace events to a file/stream, e.g. via a command-line switch? Consuming CDP may be challenging in PaaS environments, due to network constraints, process constraints, ... |
File output would still be supported. |
should this remain open? [ I am trying to chase dormant issues to closure ] |
This can be closed |
in stateless/paas environments, we want trace-event data to be written to a configurable, arbitrary "sink" (i.e., a stream that can be a socket, file, ...).
For context, at diagnostics summit, we discussed getting "failure" data off of stateless environments in general. We identified three types of data we're interested in:
stdout/stderr is configurable by redirecting the stream.
core dumps are configurable via the host environment
This leaves only trace-event data that we want to configure.
The text was updated successfully, but these errors were encountered: