Skip to content

tracesSampler "name" property missing route name with Fastify integration #12944

Closed
@MattJustMatt

Description

@MattJustMatt

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/node

SDK Version

8.18

Framework Version

Fastify v4

Link to Sentry event

No response

SDK Setup/Reproduction Example

Sentry.init({
dsn: "https://763f4daed63fb0d58072fa782c353c8d@o4505228622036992.ingest.us.sentry.io/4505903337570304",
debug: false,
integrations: [
nodeProfilingIntegration(),
],

tracesSampler: ({ name, attributes, parentSampled }) => {
// for fastify routes, name is always just the http method e.g. "GET"
}

Steps to Reproduce

See above ^

Expected Result

name should be the full route name e.g. POST /games/:gameId/join

Actual Result

The name returned is just "POST" I can get the url from attributes but this isn't ideal for parameterized routes.

Overall was a smooth experience upgrading from v7/fastify-sentry to native v8, great update otherwise! :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Package: nodeIssues related to the Sentry Node SDK

    Type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions