-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Closed
Labels
agentLanguage agent related.Language agent related.bugSomething isn't working and you are sure it's a bug!Something isn't working and you are sure it's a bug!nodejsNodeJS backend agent relatedNodeJS backend agent related
Milestone
Description
Search before asking
- I had searched in the issues and found no similar issues.
Apache SkyWalking Component
NodeJS Server Side Agent (apache/skywalking-nodejs)
What happened
when i user router in expressjs with skywalking, some went wrong.
app.use("/hello/",async function (req, res) {
res.send("Hello")
})
// this is router
const router = express.Router()
router.get("/router/", async function (req, res) {
res.send("Hello router")
})
app.use(router)
app.use("/hello2/", async function (req, res) {
res.send("Hello2");
});
and the result is:
this is OK:

but this has two records in skywalking:

and this has two records and tell me has error:

What you expected to happen
/router/ and /hello2/aaa has one record and has no error。
How to reproduce
1. start this server:
var express = require('express')
var agent = require('skywalking-backend-js').default
agent.start({
serviceName: "***",
collectorAddress: "***",
})
const app = express()
app.use("/hello/", async function (req, res) {
res.send("Hello")
})
const router = express.Router()
router.get("/router/", async function (req, res) {
res.send("Hello router")
})
app.use(router)
app.use("/hello2/", async function (req, res) {
res.send("Hello2");
});
const PORT = 4444
app.listen(PORT, () => {
console.log(`Example app listening at http://localhost:${PORT}`)
})
2. Visit web address
http://localhost:4444/hello/aaa
http://localhost:4444/router/
http://localhost:4444/hello2/aaa
3. see the skywalking dashboard
Anything else
No response
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
agentLanguage agent related.Language agent related.bugSomething isn't working and you are sure it's a bug!Something isn't working and you are sure it's a bug!nodejsNodeJS backend agent relatedNodeJS backend agent related