Skip to content

Create spans via decorators #2

@ewhauser

Description

@ewhauser

Creating a span for every component using component lifecycle events can be tedious. A better (?) approach could be to inject tracing behavior as a mixin via decorators:

@Component({
   selector: 'app-heroes',
   templateUrl: './heroes.component.html'
 })
@Trace({start: OnInit, end: OnDestroy})
 export class HeroesComponent { 
  localspan: LocalSpan;

The current problem with this approach is it breaks tree shaking for your application:

https://blog.nrwl.io/metaprogramming-higher-order-components-and-mixins-with-angular-ivy-75748fcbc310

so this shouldn't be built until Angular Ivy is released.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions