StartSpan starts a new trace span as child of the current span
( ctx context.Context, name string, meta Meta, )
| 149 | |
| 150 | // StartSpan starts a new trace span as child of the current span |
| 151 | func (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 |
| 176 | func (m *Monitoring) SendError(ctx context.Context, errType string, err errctx.Error) { |