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

"Instrumenting a library" is misleading (at least me) #70

Open
guettli opened this issue Jan 6, 2017 · 2 comments
Open

"Instrumenting a library" is misleading (at least me) #70

guettli opened this issue Jan 6, 2017 · 2 comments

Comments

@guettli
Copy link
Contributor

guettli commented Jan 6, 2017

I think the title "Instrumenting a library" is misleading.

I refer to this page: http://zipkin.io/pages/instrumenting.html

I guess the meaning of the title is "Creating a new instrumenting library".

Background: I had the idea of tracing the internals of a library (single process, single thread, not RPC) ... I would call this "Instrumenting a library" :-)

@codefromthecrypt
Copy link
Member

Along this note, it does seem we need two different or maybe three sections.

  • users of existing trace instrumentation generally have fewer things to answer.. ex what are usual default span names and tags, and what guidelines are there for custom ones
  • developers of trace instrumentation need to know the general practice of using a tracer, ex. propagation, making sure default tags are in place, not making spans too big or without service name (this is mostly our existing doc)
  • developers of tracers need to know encoding, propagation formats, the model, async reporting etc

we've had some questions come up which hints that the first point above could help others..

@triks80

Can someone help with a guideline on best practices for using Zipkin? Tags, naming spans etc., I feel like I am using this product without a manual and groping for things in the dark.

@codefromthecrypt
Copy link
Member

here are some notes about the questions asked

on span naming the main concern is that the names are low cardinality (they don't repeat endlessly due to containing variables)
ex. that's why the http method is the default name in most zipkin http instrumentation (there's only several of these, and in the UI drop-down no problem)
good names are short and are useful grouping on their own. Ex. if I make one called "get /trace/" that would be ok, but "get /trace/1231234" would be bad as the latter would repeat for each id

on tagging, instrumentation usually have default tags already setup, like http.url these are documented here https://github.com/openzipkin/zipkin-api/blob/master/thrift/zipkinCore.thrift
user defined tags/binary annotations serve two purposes: exact match lookup for the search screen and details for the trace view (specifically the span detail screen)
so user-defined tags are sometimes things like an application-specific request id. you would add that so that you can search by this
possibly the user or the framework.. things like this
then, sometimes people add more verbose tags that aren't searchable. ex the parameters of an operation.
the current docs mention guidance which is to not load up tags with too much, as it will reduce the usability of the system (<1KiB is good)

codefromthecrypt pushed a commit to openzipkin/zipkin-js that referenced this issue Apr 3, 2017
Default span names are good choices as they are bounded. However, users
may want to change these to other bounded choices (ex names that don't
include variables). This shows how to accomplish this.

Note: it is quite common for custom code to get naming wrong, by using
high cardinality names such as specific http paths. This is one reason
why defaults are limited, as tags/binary annotations can be used to add
more specific lookup criteria without degrading the UI.

See #96
See openzipkin/openzipkin.github.io#70 (comment)
codefromthecrypt pushed a commit to openzipkin/zipkin-js that referenced this issue Jul 4, 2017
Default span names are good choices as they are bounded. However, users
may want to change these to other bounded choices (ex names that don't
include variables). This shows how to accomplish this.

Note: it is quite common for custom code to get naming wrong, by using
high cardinality names such as specific http paths. This is one reason
why defaults are limited, as tags/binary annotations can be used to add
more specific lookup criteria without degrading the UI.

See #96
See openzipkin/openzipkin.github.io#70 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants