Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Zipkin -n- OpenTracing

Adrian Cole
December 20, 2016

Zipkin -n- OpenTracing

presentation I aimed to give at CloudNativeCon Seattle, but logistics made it not happen

Adrian Cole

December 20, 2016
Tweet

More Decks by Adrian Cole

Other Decks in Programming

Transcript

  1. Zipkin has pluggable architecture Tracers report spans HTTP or Kafka.

    Servers collect spans, storing them in MySQL, Cassandra, or Elasticsearch. Users query for traces via Zipkin’s Web UI or Api. services: storage: image: openzipkin/zipkin-elasticsearch container_name: elasticsearch ports: - 9300:9300 server: image: openzipkin/zipkin environment: - STORAGE_TYPE=elasticsearch - ES_HOSTS=elasticsearch ports: - 9411:9411 depends_on: - storage
  2. Zipkin has starter architecture Tracing is new for a lot

    of folks. For many, the MySQL option is a good start, as it is familiar. services: storage: image: openzipkin/zipkin-mysql container_name: mysql ports: - 3306:3306 server: image: openzipkin/zipkin environment: - STORAGE_TYPE=mysql - MYSQL_HOST=mysql ports: - 9411:9411 depends_on: - storage
  3. Zipkin can be as simple as a single file $

    curl -SL 'https://search.maven.org/remote_content?g=io.zipkin.java&a=zipkin-server&v=LATEST&c=exec' > zipkin.jar $ SELF_TRACING_ENABLED=true java -jar zipkin.jar . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v1.4.0.RELEASE) 2016-08-01 18:50:07.098 INFO 8526 --- [ main] zipkin.server.ZipkinServer : Starting ZipkinServer on acole with PID 8526 (/Users/acole/oss/sleuth-webmvc-example/zipkin.jar started by acole in /Users/acole/oss/sleuth-webmvc- example) —snip— $ curl -s localhost:9411/api/v1/services|jq . [ "zipkin-server" ]
  4. Zipkin lives in GitHub Zipkin was created by Twitter in

    2012. In 2015, OpenZipkin became the primary fork. OpenZipkin is an org on GitHub. It contains tracers, OpenApi spec, service components and docker images. https://github.com/openzipkin
  5. • Trace sampling is before the fact • Client and

    server spans can share a span ID • Spans are reported in Thrift or Json • Trace identifiers are propagated as X-B3 http headers • This is very important for interop! • Arbitrary baggage is out-of-scope Zipkin defines a span and propagation format.
  6. • Logs map to (String, timestampMicros) [Annotation] • Tags map

    to (String, String) [BinaryAnnotation] • Tags special-case RPC details such as role and peer • When RPC, start/end events are recorded Mapping OpenTracing to Zipkin Span
  7. • zipkin-go-opentracing - 1st party OpenTracing tracer • brave-opentracing -

    experimental propagation bridge • uber/jaeger-client-* - some need B3 and reporter Zipkin compatible OpenTracing libraries
  8. • zipkin-reporter-java - reporting side • zipkin-api - struct definitions

    • b3-propagation - documents propagation concerns • of course.. http://zipkin.io/pages/instrumenting.html Helpful repositories
  9. Wrapping up You can use OpenTracing to send traces to

    a Zipkin system. Support B3. With it, you’ll be compatible with any Zipkin tracer. Remember you are not alone! @adrianfcole #zipkin gitter.im/openzipkin/zipkin zipkin-go-opentracing example