opentracing-python icon indicating copy to clipboard operation
opentracing-python copied to clipboard

Too much code

Open guettli opened this issue 8 years ago • 8 comments

Don't get me wrong. I love typing.

But I think the current two examples (inbound, outbound) of the README are too long.

I guess more could be done in the library.

Why is it not possible to write the implementation of before_http_request() and before_request() in one line?

guettli avatar May 02 '17 12:05 guettli

And all = in codes have been - , is this a mistake?

liubin avatar May 11 '17 07:05 liubin

@liubin I think that is a mistake :smile:

tovin07 avatar May 17 '17 02:05 tovin07

Thank you for fixing =' being -' in README.

This issue was about a different topic (see above).

AFAIK above topic was not fixed.

guettli avatar May 19 '17 12:05 guettli

You're right -- github closed the issue automatically when that typo PR merged. Reopened.

bhs avatar May 19 '17 13:05 bhs

(catching up on open issues)

@guettli FYI, I would like to address this issue once PR #50 or similar is merged. The fundamental problem (IMO) is that the examples only describe HTTP request handling and don't start with simpler things first, like instrumenting a synchronous function call. While it's possible to write wrappers that simply, well, anything, things that could be a part of opentracing-contrib should at least start life there. I.e., I do not want to clutter the core opentracing-python lib with helpers that just reduce typing.

bhs avatar May 28 '17 21:05 bhs

I personally think we need a few simple "code labs" in each popular language that we could also use in the workshops at conferences, i.e.

  • hello world one-span example
  • traced function example
  • traced async function
  • traced http request
  • traced server-server example

Opened https://github.com/opentracing/specification/issues/73

yurishkuro avatar May 30 '17 23:05 yurishkuro

Unless the intention is to replace the examples with something completely different, I can create a PR to make that a bit easier to read. Just let me know if that can be useful ;)

tbarbugli avatar Jan 01 '18 20:01 tbarbugli

@tbarbugli it's difficult to say "if that can be useful" without actually seeing the different examples. The current examples have reasons for being written the way they are. As @bhs mentioned, one of the more obscure parts is the in-process span propagation that will be addressed soon with the new API changes.

Side note - might be worth pointing to opentracing-tutorial for simpler examples.

yurishkuro avatar Jan 01 '18 21:01 yurishkuro