-
Notifications
You must be signed in to change notification settings - Fork 2
Trace exporter implemetation #1
base: master
Are you sure you want to change the base?
Conversation
rescue StandardError => err | ||
warn "Unable to export to OCAgent service: #{err.class} #{err}" | ||
ensure | ||
Thread.pass |
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.
Why is this needed?
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 have added rescue block just for logging purpose, issues like not able to established connection to agent service
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.
ensure block to pass immediate execution if other threads running in process.
|
||
# Run exporter stream. | ||
def background_export_run | ||
client.export(@trace_req_queue.each_item).each {} |
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.
Why do you need to call .each{}
on the result?
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.
export is bidirectional grpc call which need to be kept alive for the entire life of process and export returning Enumerator instance with empty objects.
# Stop the trace export stream. | ||
def stop | ||
@stopped = true | ||
@trace_req_queue&.push TraceEnumeratorQueue::SENTINEL |
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.
What happens when background_export_run
reaches the sentinel?
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.
When it reached the sentinel, it will break the export grpc bidirectional call and export thread execution will complete
No description provided.