$30 off During Our Annual Pro Sale. View Details »

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 -n- OpenTracing @adrianfcole #zipkin

  2. Introduction introduction zipkin opentracing wrapping up @adrianfcole #zipkin

  3. @adrianfcole • spring cloud at pivotal • focused on distributed

    tracing • helped open zipkin
  4. Zipkin introduction zipkin opentracing wrapping up @adrianfcole #zipkin

  5. Zipkin is a distributed tracing system

  6. 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
  7. 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
  8. 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" ]
  9. 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
  10. OpenTracing introduction zipkin opentracing wrapping up @adrianfcole #zipkin

  11. • 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.
  12. • 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
  13. • zipkin-go-opentracing - 1st party OpenTracing tracer • brave-opentracing -

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

    • b3-propagation - documents propagation concerns • of course.. http://zipkin.io/pages/instrumenting.html Helpful repositories
  15. Wrapping Up introduction zipkin opentracing wrapping up @adrianfcole #zipkin

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