MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / StartSpan

Method StartSpan

monitoring/monitoring.go:151–173  ·  view source on GitHub ↗

StartSpan starts a new trace span as child of the current span

(
	ctx context.Context,
	name string,
	meta Meta,
)

Source from the content-addressed store, hash-verified

149
150// StartSpan starts a new trace span as child of the current span
151func (m *Monitoring) StartSpan(
152 ctx context.Context,
153 name string,
154 meta Meta,
155) (context.Context, context.CancelFunc) {
156 cancels := make([]context.CancelFunc, 0, len(m.monitors))
157
158 for _, monitor := range m.monitors {
159 var cancel context.CancelFunc
160
161 //nolint:fatcontext
162 ctx, cancel = monitor.StartSpan(ctx, name, meta)
163 cancels = append(cancels, cancel)
164 }
165
166 cancel := func() {
167 for _, c := range cancels {
168 c()
169 }
170 }
171
172 return ctx, cancel
173}
174
175// SendError sends an error to all monitoring services
176func (m *Monitoring) SendError(ctx context.Context, errType string, err errctx.Error) {

Callers

nothing calls this directly

Calls 1

StartSpanMethod · 0.65

Tested by

no test coverage detected