Skip to content

Commit c87d24a

Browse files
committed
fix: use zap logger
Signed-off-by: nabil salah <[email protected]>
1 parent b8e5704 commit c87d24a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

internal/sampling/samplingstrategy/adaptive/aggregator.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,15 +151,15 @@ func (a *aggregator) HandleRootSpan(span *span_model.Span, logger *zap.Logger) {
151151
if service == "" || span.OperationName == "" {
152152
return
153153
}
154-
samplerType, samplerParam := a.getSamplerParams(span)
154+
samplerType, samplerParam := a.getSamplerParams(span, logger)
155155
if samplerType == span_model.SamplerTypeUnrecognized {
156156
return
157157
}
158158
a.RecordThroughput(service, span.OperationName, samplerType, samplerParam)
159159
}
160160

161161
// GetSamplerParams returns the sampler.type and sampler.param value if they are valid.
162-
func (a *aggregator) getSamplerParams(s *span_model.Span) (span_model.SamplerType, float64) {
162+
func (a *aggregator) getSamplerParams(s *span_model.Span, logger *zap.Logger) (span_model.SamplerType, float64) {
163163
samplerType := s.GetSamplerType()
164164
if samplerType == span_model.SamplerTypeUnrecognized {
165165
return span_model.SamplerTypeUnrecognized, 0
@@ -170,7 +170,7 @@ func (a *aggregator) getSamplerParams(s *span_model.Span) (span_model.SamplerTyp
170170
}
171171
samplerParam, err := samplerParamToFloat(tag)
172172
if err != nil {
173-
a.postAggregator.logger.
173+
logger.
174174
With(zap.String("traceID", s.TraceID.String())).
175175
With(zap.String("spanID", s.SpanID.String())).
176176
Warn("sampler.param tag is not a number", zap.Any("tag", tag))

0 commit comments

Comments
 (0)