Skip to content

Commit

Permalink
fix: use zap logger
Browse files Browse the repository at this point in the history
Signed-off-by: nabil salah <[email protected]>
  • Loading branch information
Nabil-Salah committed Jan 21, 2025
1 parent b8e5704 commit c87d24a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/sampling/samplingstrategy/adaptive/aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,15 @@ func (a *aggregator) HandleRootSpan(span *span_model.Span, logger *zap.Logger) {
if service == "" || span.OperationName == "" {
return
}
samplerType, samplerParam := a.getSamplerParams(span)
samplerType, samplerParam := a.getSamplerParams(span, logger)
if samplerType == span_model.SamplerTypeUnrecognized {
return
}
a.RecordThroughput(service, span.OperationName, samplerType, samplerParam)
}

// GetSamplerParams returns the sampler.type and sampler.param value if they are valid.
func (a *aggregator) getSamplerParams(s *span_model.Span) (span_model.SamplerType, float64) {
func (a *aggregator) getSamplerParams(s *span_model.Span, logger *zap.Logger) (span_model.SamplerType, float64) {

Check failure on line 162 in internal/sampling/samplingstrategy/adaptive/aggregator.go

View workflow job for this annotation

GitHub Actions / lint

unused-receiver: method receiver 'a' is not referenced in method's body, consider removing or renaming it as _ (revive)
samplerType := s.GetSamplerType()
if samplerType == span_model.SamplerTypeUnrecognized {
return span_model.SamplerTypeUnrecognized, 0
Expand All @@ -170,7 +170,7 @@ func (a *aggregator) getSamplerParams(s *span_model.Span) (span_model.SamplerTyp
}

Check warning on line 170 in internal/sampling/samplingstrategy/adaptive/aggregator.go

View check run for this annotation

Codecov / codecov/patch

internal/sampling/samplingstrategy/adaptive/aggregator.go#L169-L170

Added lines #L169 - L170 were not covered by tests
samplerParam, err := samplerParamToFloat(tag)
if err != nil {
a.postAggregator.logger.
logger.
With(zap.String("traceID", s.TraceID.String())).
With(zap.String("spanID", s.SpanID.String())).
Warn("sampler.param tag is not a number", zap.Any("tag", tag))
Expand Down

0 comments on commit c87d24a

Please sign in to comment.