Skip to content

Feature request: captureMethod decorator for sync/async methods #1204

Closed
@kennethwkz-mm

Description

@kennethwkz-mm

Use case

Important

EDIT: see this comment for updated scope & context

For captureMethod - Method decorator able to support both async/sync function together

Solution/User Experience

We can add new option parameter - async to let user determine when the function need capture sync function.

class Something {
  tracer.captureMethod({ async: false })
  public myMethod {
     // do stuff
  }
}

Alternative solutions

const tracer = new Tracer();

const myFunction = () => { //do something  };

const handler = () => {
  const result = tracer.provider.captureFunc('my subsegment name', myFunction);
}

Acknowledgment

Metadata

Metadata

Assignees

Labels

feature-requestThis item refers to a feature request for an existing or new utilityrejectedThis is something we will not be working on. At least, not in the measurable futuretracerThis item relates to the Tracer Utility

Type

No type

Projects

Status

Closed

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions