Skip to content

sentry/nestjs - using SentryTraced decorator results in inaccessible class function name #13683

Closed
@drakedeatonuk

Description

@drakedeatonuk

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/browser

SDK Version

8.30

Framework Version

No response

Link to Sentry event

No response

Reproduction Example/SDK Setup

class ExampleService {

  @SentryTraced()
  async init() {
    console.log(this.init.name) // should be "init", but is undefined.
  }

}

Steps to Reproduce

  1. import sentry/nestjs
  2. add the SentryTraced decorator to any nestjs service function
  3. print the wrapped-function's name to the console.

Expected Result

I would expect the function to retain it's name when the SentryTraced decorator is used.

We rely heavily on the.fn.name thoughout our codebase's logging.

Actual Result

using the SentryTraced decorator results in the class function instance having no accessible the.fn.name property.

Metadata

Metadata

Assignees

Labels

Package: nestjsIssues related to the Sentry Nestjs SDK

Type

Projects

Status

Waiting for: Product Owner

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions