Skip to content

Comments

fix: entry span url in endponts using Express middleware/router objects#96

Merged
kezhenxu94 merged 11 commits intoapache:masterfrom
BFergerson:master
Oct 14, 2022
Merged

fix: entry span url in endponts using Express middleware/router objects#96
kezhenxu94 merged 11 commits intoapache:masterfrom
BFergerson:master

Conversation

@BFergerson
Copy link
Member

The following code:

const app = express();
const testRouter = express.Router();

app.use('/test', testRouter);
testRouter.get('/express', (req, res) => {
    res.sendStatus(200);
});

app.listen(3000);

Results in entry spans with the URL of /express and not the correct URL of /test/express.

This PR solves that using req.originalUrl when available.

@BFergerson BFergerson changed the title fix: correct entry span url in endponts using Express middleware/router objects fix: entry span url in endponts using Express middleware/router objects Oct 14, 2022
@wu-sheng wu-sheng added the enhancement New feature or request label Oct 14, 2022
@wu-sheng wu-sheng added this to the 0.6.0 milestone Oct 14, 2022
Copy link
Member

@kezhenxu94 kezhenxu94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

@kezhenxu94 kezhenxu94 merged commit 2b9300a into apache:master Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants