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

ConsoleSpanExporter doesn't print out as expected #448

Closed
codeboten opened this issue Feb 27, 2020 · 6 comments · Fixed by #455
Closed

ConsoleSpanExporter doesn't print out as expected #448

codeboten opened this issue Feb 27, 2020 · 6 comments · Fixed by #455
Labels
bug Something isn't working

Comments

@codeboten
Copy link
Contributor

Environment

I setup a new virtualenv and ran through the http example: https://github.com/open-telemetry/opentelemetry-python/tree/master/examples/http.

Expected

After running the client, I was expecting to see the span being printed in both the client and the server consoles.

Actual

The span was printed to the client console. On the server side, the span was only printed once I exited the application (ctrl+c)

@codeboten codeboten added the bug Something isn't working label Feb 27, 2020
@c24t
Copy link
Member

c24t commented Feb 28, 2020

That's because of the BatchExportSpanProcessor, it only exports every 60 seconds or immediately on exit. The client prints because it exits, but you'd see the same thing with e.g. a sleep at the end.

This is confusing behavior for an example though.

@codeboten
Copy link
Contributor Author

I just tested this again with the batch processor, waited over 2 minutes and still nothing until I cancelled the server process. I haven't tested this with other exporters to test the behaviour. I agree the example should probably be changed to use the SImple processor, but I think there is still a regression somewhere in the ConsoleSpanExporter

@ocelotl
Copy link
Contributor

ocelotl commented Feb 28, 2020

I just tested this again with the batch processor, waited over 2 minutes and still nothing until I cancelled the server process. I haven't tested this with other exporters to test the behaviour. I agree the example should probably be changed to use the SImple processor, but I think there is still a regression somewhere in the ConsoleSpanExporter

Yes, I also think there is a regression. This is happening with the auto instrumentation example too, it didn't happen before.

@knabben
Copy link

knabben commented Mar 2, 2020

Looks like the flush of the buffering never happens, maybe it makes sense to call self.out.flush() at the end of ConsoleSpanExporter.export.

@mauriciovasquezbernal
Copy link
Member

@knabben yes, you are right. I am already preparing a patch for this issue.

@mauriciovasquezbernal
Copy link
Member

exports every 60 seconds

Actually the default delay is 5 seconds

I am proposing a fix for this on #455.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
5 participants