SkyAPM/SkyAPM-nodejs

await will generate new tracerId

Opened this issue · 0 comments

my code is

server.get("/serverB", async function (req, res) {
  let mysql = require("mysql");

  await querySleep(1);
  await querySleep(1);

  res.writeHead(200, { "Content-Type": "text/html" });
  res.write("<html><body><p>This is student Page.</p></body></html>");
  res.end();
});

async function querySleep(time) {
  return new Promise(function (resolve, rej) {
    connection.query("SELECT SLEEP(1)", function (error, results, fields) {
      if (error) throw rej(error);
      resolve("");
    });
  });
}

then the web show:
image