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

[azure exporter] Manual flushing of Tracer exporter #1203

Open
Willem-J-an opened this issue May 3, 2023 · 1 comment
Open

[azure exporter] Manual flushing of Tracer exporter #1203

Willem-J-an opened this issue May 3, 2023 · 1 comment
Labels

Comments

@Willem-J-an
Copy link

Is your feature request related to a problem?
When running in specific contexts, e.g. databricks; the atexit flush is not reliable. It only flushes the spans around 60% of the time.

Describe the solution you'd like.
I would like to be able to manually flush the tracer exporter to ensure my spans are exported before letting my application exit.

Describe alternatives you've considered.
tracer.finish() - Will not block until flushing has occured
Retrieving active exporter threads and stopping them; thread.stop(timeout=x)
Calling private _stop method on the tracer.exporter

Additional context.
Discussed here

@jeremydvoss
Copy link
Collaborator

The way this currently works relies on the opencensus.common.schedule.Queue object and specifically the _gets method. Here's what I have found. The _gets is always operating in the worker thread. It only exits when either the count reaches the max_batch_size, export_interval time has elapsed, or a QueueEvent is queued. I tried flushing the queue with exporter._queue.flush(). This inserts a SYNC queue event, but still does not interrupt the _gets for some reason. Will continue to explore options.

@lzchen lzchen added the azure Microsoft Azure label Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants