Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Too much code #47

Open
guettli opened this issue May 2, 2017 · 8 comments
Open

Too much code #47

guettli opened this issue May 2, 2017 · 8 comments

Comments

@guettli
Copy link

guettli commented May 2, 2017

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?

@liubin
Copy link

liubin commented May 11, 2017

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

@tovin07
Copy link
Contributor

tovin07 commented May 17, 2017

@liubin I think that is a mistake 😄

@guettli
Copy link
Author

guettli commented May 19, 2017

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

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

AFAIK above topic was not fixed.

@bhs bhs reopened this May 19, 2017
@bhs
Copy link
Contributor

bhs commented May 19, 2017

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

@bhs
Copy link
Contributor

bhs commented May 28, 2017

(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.

@yurishkuro
Copy link
Member

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 opentracing/specification#73

@tbarbugli
Copy link

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 ;)

@yurishkuro
Copy link
Member

@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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants