Open dan-cooke opened 8 months ago
First of all ,thanks for the great library! Its been a joy to work with so far
One pattern that I have noticed myself duplicating almost everywhere is this
@Span('DocumentsService.create') async create(userId: string, orgId: string, dto: CreateDocumentDto) { this.traceService.getSpan().setAttributes({ orgId, userId, dto: JSON.stringify(dto), }); // --- snip
Where I annotate a function with Span, and then immediately set the function args into the span attributes.
Is it possible with reflect-metadata to roll that code into @Span , maybe something like this
@Span('DocumentsService.create', ['userId', 'orgId', 'dto'])
Where users have to explicitly set the fields they want to attach to attributes
I am used to this in rust, but I'm not sure if the TS compiler is capable of something like that
Hey! this is a reasonable ask, PRs are welcome but it will be quite hard if you want to customize the attribute names. You might need to think about a more customizable interface
First of all ,thanks for the great library! Its been a joy to work with so far
One pattern that I have noticed myself duplicating almost everywhere is this
Where I annotate a function with Span, and then immediately set the function args into the span attributes.
Question
Is it possible with reflect-metadata to roll that code into @Span , maybe something like this
Where users have to explicitly set the fields they want to attach to attributes
I am used to this in rust, but I'm not sure if the TS compiler is capable of something like that