-
Notifications
You must be signed in to change notification settings - Fork 146
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
Added BatchSpanProcessor metrics on drop and export span #635
base: main
Are you sure you want to change the base?
Added BatchSpanProcessor metrics on drop and export span #635
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm following Java SDK implementation from here
self.queueSizeGauge = meter.gaugeBuilder(name: "queueSize") | ||
.ofLongs() | ||
.setDescription("The number of items queued") | ||
.setUnit("1") | ||
.buildWithCallback { result in | ||
result.record( | ||
value: maxQueueSize, | ||
attributes: [ | ||
BatchSpanProcessor.SPAN_PROCESSOR_TYPE_LABEL: .string(BatchSpanProcessor.SPAN_PROCESSOR_TYPE_VALUE) | ||
] | ||
) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I followed Java SDK implementation and convention, and here maxQueueSize
will be always fixed. Is that a right use case?
|
||
func addSpan(span: ReadableSpan) { | ||
cond.lock() | ||
defer { cond.unlock() } | ||
|
||
if spanList.count == maxQueueSize { | ||
// TODO: Record a counter for dropped spans. | ||
processedSpansCounter.add(value: 1, attribute: droppedAttrs) | ||
return | ||
} | ||
// TODO: Record a gauge for referenced spans. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not clear on proper use-case here. Please explain the use-case and I can add the functionality @nachoBonafonte @bryce-b
cond.lock() | ||
processedSpansCounter.add(value: spanList.count, attribute: exportedAttrs) | ||
cond.unlock() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm using same lock here to modify the counter
Added BatchSpanProcessor metrics on drop and export span