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

Go kit - A Distributed Programming Toolkit

Mark Wolfe
November 25, 2015

Go kit - A Distributed Programming Toolkit

Presented at the microservices meetup in Melbourne, Australia

Mark Wolfe

November 25, 2015
Tweet

More Decks by Mark Wolfe

Other Decks in Programming

Transcript

  1. Go kit
    A Distributed Programming Toolkit

    View full-size slide

  2. Intro
    • Mark Wolfe
    • DevOps at Versent
    • IoT & Distributed Systems

    View full-size slide

  3. go-kit?!
    • Composable
    • Opinionated
    • Service Orientated
    • Simple to Deploy

    View full-size slide

  4. Server Package
    • Go interfaces
    • Provides:
    • Encoding/Decoding
    • Tracing and Health
    • Transport, Rate Limiting and Throttling
    • Discovery

    View full-size slide

  5. Client Package
    • Go interfaces
    • Provides:
    • Encoding/Decoding
    • Transport, Pooling, Rate Limiting & Circuit Breaker
    • Tracing

    View full-size slide

  6. !Important
    • Circuit Breaker
    • Stops thundering herds
    • prevents sending requests that are likely to fail
    • Rate Limiter
    • Enforce upper thresholds on request throughput

    View full-size slide

  7. Logging
    • Levels, e.g. Info, Error
    • Stdout, Stderr
    • Keyvals or JSON
    // Output:
    // foo=123
    // level=info
    // level=info msg=hello
    // level=info msg=hello a=1 b=2

    View full-size slide

  8. Discovery
    • Inbuilt Service Discovery
    • DNS Srv Record
    • Etcd
    • Consul

    View full-size slide

  9. Metrics!
    • Runtime, Application, Business
    • Counter, Histogram and Gauges
    • Stdout, StatsD or Prometheus
    import "github.com/go-kit/kit/metrics/expvar"
    func main() {
    myCount := expvar.NewCounter("my_count")
    myCount.Add(1)
    }

    View full-size slide

  10. Example Code!

    View full-size slide

  11. Questions
    • @wolfeidau on Twitter
    • https://github.com/wolfeidau
    [email protected]

    View full-size slide

  12. Links
    • Go Kit
    • Circuit Breaker Pattern
    • Dapper, a Large-Scale Distributed Systems Tracing
    Infrastructure
    • The Zipkin distributed tracing project

    View full-size slide