Skip to content

Support "start" utility functions #7

@Crocmagnon

Description

@Crocmagnon

Describe the solution you'd like
Currently, it seems like spancheck only looks for Start methods called directly on the otel package. It would be nice to be able to add custom start methods or packages.

Additional context
My company internally provides common tooling around tracing. One of these tools is a function to start a span. It's basically a thin wrapper around otel.Tracer("name").Start(ctx, name, opts...). Its implementation could be summarized as such:

package tracing

func Start(ctx context.Context, name string, opts ...trace.SpanStartOption) (context.Context, trace.Span) {
	return otel.Tracer("some-name").Start(ctx, name, opts...)
}

It's used like this:

ctx, span := tracing.Start(ctx, "spanName")
defer span.End()

These calls aren't detected by spancheck

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions