Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Yuri Shkuro <github@ysh.us>
  • Loading branch information
yurishkuro committed Apr 15, 2022
1 parent ab3d25a commit 2a468b8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 7 additions & 1 deletion cmd/collector/app/sanitizer/sanitizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ import (
// span should implement this interface.
type SanitizeSpan func(span *model.Span) *model.Span

// NewChainedSanitizer creates a Sanitizer from the variadic list of passed Sanitizers
// StandardSanitizers are automatically applied by SpanProcessor.
var StandardSanitizers []SanitizeSpan = []SanitizeSpan{
NewEmptyServiceNameSanitizer(),
}

// NewChainedSanitizer creates a Sanitizer from the variadic list of passed Sanitizers.
// If the list only has one element, it is returned directly to minimize indirection.
func NewChainedSanitizer(sanitizers ...SanitizeSpan) SanitizeSpan {
if len(sanitizers) == 1 {
return sanitizers[0]
Expand Down
4 changes: 1 addition & 3 deletions cmd/collector/app/span_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,7 @@ func newSpanProcessor(spanWriter spanstore.Writer, additional []ProcessSpan, opt
}
boundedQueue := queue.NewBoundedQueue(options.queueSize, droppedItemHandler)

sanitizers := []sanitizer.SanitizeSpan{
sanitizer.NewEmptyServiceNameSanitizer(),
}
sanitizers := append([]sanitizer.SanitizeSpan{}, sanitizer.StandardSanitizers...)
if options.sanitizer != nil {
sanitizers = append(sanitizers, options.sanitizer)
}
Expand Down

0 comments on commit 2a468b8

Please sign in to comment.