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 Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View 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 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 Slide

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

    View 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 Slide

  10. Example Code!

    View Slide

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

    View Slide

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

    View Slide