sourcegraph / appdash

Application tracing system for Go, based on Google's Dapper.
https://sourcegraph.com
Other
1.72k stars 137 forks source link

Python examples: An Issue and a question #185

Closed amitsaha closed 7 years ago

amitsaha commented 7 years ago

When I try to run example_opentracing_socket.py I get:

Traceback (most recent call last):
  File "example_opentracing_socket.py", line 32, in <module>
    child_span = tracer.start_span("child", parent=span)
TypeError: start_span() got an unexpected keyword argument 'parent'

I removed the parent kwarg and tried to assign the .parent attribute, but it didn't set the relationship correctly.

My second "issue" is a question:

Looking at example_socket.py, I don't see a span being finished or closed. A quick look at the Golang demo web app shows that a span is explicitly finished by a function call. How does a Python client application finish a span?

alanjds commented 7 years ago

The PR #186 fixes your traceback.

About the 2nd "issue", I guess the recv says the time of "closing" for the span.

slimsag commented 7 years ago

PR #186 has been merged.

Re: 2nd issue -- it's true the recv parameter says the time of closing for the span. You can see this in action here: https://github.com/sourcegraph/appdash/blob/master/python/example_socket.py#L32

Also, it defaults to the current time, meaning that you can omit it and just consider collection time to be the same as span closing time.

If you have more questions / suggestions please open a new issue :)