Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: In Collector, expose droppedSpanHandler as an option #4375

Closed
vprithvi opened this issue Apr 7, 2023 · 2 comments · Fixed by #4387
Closed

[Feature]: In Collector, expose droppedSpanHandler as an option #4375

vprithvi opened this issue Apr 7, 2023 · 2 comments · Fixed by #4387

Comments

@vprithvi
Copy link
Contributor

vprithvi commented Apr 7, 2023

Requirement

As a Jaeger operator, I'd like to have customized handling when spans are dropped due to incoming queue being full on Jaeger Collector.

Problem

The droppedItemHandler is configured inside newSpanProcessor.

func newSpanProcessor(spanWriter spanstore.Writer, additional []ProcessSpan, opts ...Option) *spanProcessor {
options := Options.apply(opts...)
handlerMetrics := NewSpanProcessorMetrics(
options.serviceMetrics,
options.hostMetrics,
options.extraFormatTypes)
droppedItemHandler := func(item interface{}) {
handlerMetrics.SpansDropped.Inc(1)
}
boundedQueue := queue.NewBoundedQueue(options.queueSize, droppedItemHandler)

Proposal

Use the existing Options struct to add a new OnDroppedSpan, use a type assertion internally to convert the interface{} to a *model.Span.

type OnDroppedSpan func(span *model.Span)

func newSpanProcessor(...

	droppedItemHandler := func(item interface{}) {
		handlerMetrics.SpansDropped.Inc(1)
	}

	if options.onDroppedSpan != nil {
		droppedItemHandler = func(iSpan interface{}) {
			options.onDroppedSpan(iSpan.(*model.Span))
		}
	}

Open questions

No response

@eshwarhs
Copy link

eshwarhs commented Apr 8, 2023

Hi, I would like to take this up. Can you assign it to me @yurishkuro

yurishkuro added a commit that referenced this issue Apr 16, 2023
## Which problem is this PR solving?
Resolves #4375

## Short description of the changes
Expose drop span hook as an option when creating SpanProcessor in
collector so that users have the flexibility to get more insights on
dropped spans in addition to the dropped count.

Signed-off-by: Chen Xu <chen.x@uber.com>
Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants