Skip to content

Also check for spans ending prematurely #41

@bjornbyte

Description

@bjornbyte

It's great to check for spands that are started and not ended, but I've also seen cases where the span was accidentally ended before it should have been. Specifically this happens when getting the active span from context followed by defere spane.End(). This happens most often when refactoring code and deciding you don't need a new span for a particular function and so change the code starting a new span to get the active span from context in order to add attributes to it. Or you just have engineers adding defer span.End() by reflex after creating or getting the span, so it would be nice to have the linter catch that as well.

I.e. the linter should check for defer span.End() without a preceding new span start.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions