A standard library for microservices.

Overview

Go kit

GitHub Workflow Status GoDev codecov Go Report Card Sourcegraph

Go kit is a programming toolkit for building microservices (or elegant monoliths) in Go. We solve common problems in distributed systems and application architecture so you can focus on delivering business value.

Sponsors

Click on Sponsor, above, for more information on sponsorship.

Motivation

Go has emerged as the language of the server, but it remains underrepresented in so-called "modern enterprise" companies like Facebook, Twitter, Netflix, and SoundCloud. Many of these organizations have turned to JVM-based stacks for their business logic, owing in large part to libraries and ecosystems that directly support their microservice architectures.

To reach its next level of success, Go needs more than simple primitives and idioms. It needs a comprehensive toolkit, for coherent distributed programming in the large. Go kit is a set of packages and best practices, which provide a comprehensive, robust, and trustable way of building microservices for organizations of any size.

For more details, see the website, the motivating blog post and the video of the talk. See also the Go kit talk at GopherCon 2015.

Goals

  • Operate in a heterogeneous SOA — expect to interact with mostly non-Go-kit services
  • RPC as the primary messaging pattern
  • Pluggable serialization and transport — not just JSON over HTTP
  • Operate within existing infrastructures — no mandates for specific tools or technologies

Non-goals

  • Supporting messaging patterns other than RPC (for now) — e.g. MPI, pub/sub, CQRS, etc.
  • Re-implementing functionality that can be provided by adapting existing software
  • Having opinions on operational concerns: deployment, configuration, process supervision, orchestration, etc.

Contributing

Please see CONTRIBUTING.md. Thank you, contributors!

Dependency management

Go kit is modules aware, and we encourage users to use the standard modules tooling. But Go kit is at major version 0, so it should be compatible with non-modules environments.

Code generators

There are several third-party tools that can generate Go kit code based on different starting assumptions.

Related projects

Projects with a ★ have had particular influence on Go kit's design (or vice-versa).

Service frameworks

  • gizmo, a microservice toolkit from The New York Times ★
  • go-micro, a distributed systems development framework ★
  • gotalk, async peer communication protocol & library
  • Kite, a micro-service framework
  • gocircuit, dynamic cloud orchestration

Individual components

Web frameworks

Additional reading

Comments
  • Explain why Logger.log() returns error

    Explain why Logger.log() returns error

    Hi,

    I think go-kit/kit/log reflects my personal thoughts on logging, but I am hesitant to use it directly due to Logger.log() returning an error. In my opinion errors are intended to be checked, not ignored. And it's unreasonable to ask users to check log messages. I feel a better philosophy is for the formatters/writers that eventually output messages to disk/tcp/stdout/etc to allow registering handlers for error types. Then, when I setup logging I can say "Here is a logger that logs JSON to a file. If there is an error, call this function (maybe try stdout or maybe trigger some application "debug me" state).

    Maybe something like

    type jsonLogger struct {
      io.Writer
      onError func(err error, keyvals ...interface{})
    }
    
    opened by cep21 42
  • Discussion: package pubsub

    Discussion: package pubsub

    I'd like to start thinking about a design for package pubsub/msgbus/...

    Important use cases:

    • An async transport for existing/typical RPC messaging
    • A foundation for event sourcing
    • A way to manage streaming
    • Others?

    Would like support for:

    • Kafka
    • RabbitMQ
    • NATS
    • NSQ
    • AWS SQS
    • GCP PubSub
    • Weave Mesh
    • Others?

    Prior art:

    Open questions:

    • What are the core abstractions and interfaces?
    • Is streaming significantly different than event sourcing and transport use cases?
    • What is the lowest common denominator for serialization?
    • Others?
    question 
    opened by peterbourgon 37
  • package log, alternate take

    package log, alternate take

    Inspired by #16 and the discussion there. @ChrisHines, this isn't very far along, but I'd appreciate your feedback to the general approach, which closely mirrors package metrics...

    opened by peterbourgon 34
  • Extract github.com/go-kit/kit/log to github.com/go-kit/log

    Extract github.com/go-kit/kit/log to github.com/go-kit/log

    I have several use cases, now, where it would be beneficial if projects could use Go kit's package log without pulling in anything else. I would like to extract it to it's own module and package, tentatively named kitlog to avoid the name collision. And then I would like to point the existing package at it, maybe with type aliases if they are up for the task.

    @ChrisHines — Do you think this is a reasonable idea, and is feasible? Can you identify any blockers?

    opened by peterbourgon 32
  • AMQP Transport

    AMQP Transport

    Hello,

    I noticed that here had been interest in AMQP transport similiar to NATS (#681) as well as talks of pubsub support (#295) so I thought I might like to share an implementation of a simple AMQP client & server transport.

    Comments/Reviews would be appreciated.

    opened by mattfung 31
  • log/alt_experimental_level: concept demonstration

    log/alt_experimental_level: concept demonstration

    As a foil to #357 and following up on #368, demonstrate an alternate approach to the "level" package offered via the "github.com/go-kit/kit/log/experimental_package" import path, allowing log event level filtering via instances of the (unexported) level.leveler interface, created by functions that specify the filtering threshold.

    Features not accommodated here for now:

    • Returning an error from log.Log when squelching an event
    • Returning an error from log.Log for events that lack a level
      (This feature doesn't make much sense with this approach.)
    • Squelching events that lack a level
      (This feature doesn't make much sense with this approach.)
    • Documentation
      (We could adapt much of this from the sibling package.)

    See the commit message for then benchstat comparison.

    opened by seh 30
  • Example : Ensure that http connection will be re-use

    Example : Ensure that http connection will be re-use

    Hello, It will be great into example to ensure that http connection will be re-use by ensuring that Body has be completely purged. That avoid performance problem for whom that use this example as primary guide.

    For example for https://github.com/go-kit/kit/blob/master/examples/stringsvc3/transport.go#L50, add something like this :

    func decodeUppercaseResponse(_ context.Context, r *http.Response) (interface{}, error) {
        // This defer ensures to reuse the tcp connection via HTTP/1.1
        defer io.Copy(ioutil.Discard, r.Body)
    
        var response uppercaseResponse
    

    Thx.

    question 
    opened by jerome-laforge 29
  • kitgen implementation

    kitgen implementation

    So far what I've got is simple generation based on a basic interface definition.

    Not complete: different layout engines.

    Specific design decision here was to construct the generated AST and then format it out, as opposed to using a text/template. There's some things that are made much easier this way (i.e. the output is more likely to be correct code), but the generation code is a bit more opaque. In working with this process I've found a few things that make the process clearer, and I'm looking to implement those before this is merged. Specifically, I think many of the repeated structures could be snagged from an example codefile and then processed into target structures, rather than built out of whole cloth or partial inline parses.

    opened by nyarly 28
  • Configuration

    Configuration

    Filing an issue so we consider unified configuration of some kind.

    Motivating example (though definitely not the only case): let's say a gokit process does want to do Dapper/Zipkin style tracing. The process will need to know where to forward the tracing information to, which won't be known at compile time.

    It would be nice if all of the gokit packages were configured in the same or similar way, so that as they are used modularly, configuration of subpackages happens automatically, with little programmer assistance.

    opened by jtolio 28
  • Add support for Twirp as a Transport

    Add support for Twirp as a Transport

    Twirp (https://github.com/twitchtv/twirp) is an RPC system that works over HTTP/1.1 using either JSON or Protobuf. It's leverages protobuf for generating servers and clients.

    I still need to do a few things, but wanted to get initial feedback.

    Todo

    • [ ] Add tests (planning to mirror what GRPC has)
    • [ ] Add Twirp support to addsvc example
    • [ ] Add documentation
    opened by austinylin 26
  • Go kit 0.4.0 release

    Go kit 0.4.0 release

    Edit: Due to lots of feature churn in the last few weeks/months, I've been convinced that it makes more sense to hold off on a 1.0.0 until things settle. Notes in comments below.

    Hello! I want to cut a v1.0.0 release in the near future. This issue is created per the request of @ChrisHines to serve as a notice to anyone who may be interested, for example to raise questions, concerns, or propose specific additions.

    The only thing outstanding that I'd like to get in is a promotion of log/experimental_level to log/level. I've asked @seh to weigh in on that, as he's previously commented on the package. Otherwise, let me know your thoughts. I'll leave this open until at least the weekend, so another 5 days.

    edit: outstanding issues I'd want to resolve before a 1.0.0

    • [x] #476 — Merge log/experimental_level to level; move existing levels to deprecated_levels
    • [x] #420 / #421 — use stdlib context where possible
    • [x] #432 / #437 — log: StdlibAdapter "file" key to "caller"
    • [x] Optional: #434 — log: normalize StdlibAdapter timestamp format
    • [x] Optional: #431 — transport: implement http.EncodeJSONRequest
    • [x] Evaluate breaking change: #474 — Replace log.Context with log.With/WithPrefix?

    If anyone feels strongly about either of those two Optionals, (cc: @willfaught) please get your PRs in within the next few days...

    opened by peterbourgon 26
  • [NATS transport] Support for headers in EncodeJSONResponse

    [NATS transport] Support for headers in EncodeJSONResponse

    What would you like?

    Overview

    Since release v1.11.0, nats.go supports message headers. headers are very useful to transfer metadata together with messages.

    I'm proposing to add basic support for headers in the default response encoder.

    Proposed API

    The idea is to do something similar it's done for transport/http with the Headerer interface. API change proposal is backward compatible (no public API change)

    type Headerer interface {
        Headers() Header
    }
    
    func EncodeJSONResponse(_ context.Context, reply string, nc *nats.Conn, response interface{}) error {
            msg := nats.NewMessage(reply)
            if nc. HeadersSupported() {
                    if headerer, ok := response.(Headerer); ok {
                             msg.Header = headerer.Headers()  // I wrote that to make it shorter
                    }
            }
    
    	msg.Data, err := json.Marshal(response)
    	if err != nil {
    		return err
    	}
    
    	return nc.PublishMsg(msg)
    }
    

    If the proposal is accepted I can raise a PR

    opened by mcosta74 4
  • metrics/dogstatsd: always reset all metrics before writing them when calling WriteTo

    metrics/dogstatsd: always reset all metrics before writing them when calling WriteTo

    Description

    This PR fixes an issue that occurred when the Dogstatsd client could not reach the Datadog agent to send metrics. It would fail to send counters, return and never reset timings and histograms, resulting in an ever-increasing memory consumption while the client cannot reach the Datadog agent.

    opened by skwair 11
  • Consul Implementation of Instancer spams Consul and pushes consul agents to 100% CPU

    Consul Implementation of Instancer spams Consul and pushes consul agents to 100% CPU

    What did you do?

    Using the GoKit implementation of Instancer for Consul in GoKit 0.11 and up results in Instancer spamming Consul with hundreds of RPC requests/sec on any register/deregister event that occurs after the Instancer is created. This resulted in our Consul agent pods going to 100% CPU and overwhelming our Consul cluster.

    Steps to re-create:

    1. Start Consul

    2. Register a dummy service

    curl --location --request PUT 'http://localhost:8500/v1/agent/service/register' \ --header 'Content-Type: application/json' \ --data-raw '{ "name": "db-example", "id": "db-example", "address": "127.0.0.1", "port": 5432, "tags": [ "database" ] }'

    1. Open a terminal and run the following command to get insights into what the Consul agent is doing

    consul monitor -log-level=trace

    1. Create Instancer for db-example service (see sample code below) and run app/code

    2. Deregister the service

    curl --location --request PUT 'http://localhost:8500/v1/agent/service/deregister/db-example'

    Observe the behavior from consul monitor, the agent is getting slammed with requests and it never stops until the Instancer is stopped or application exits.

    Simple example application.

    package main
    
    import (
    	"fmt"
    	"github.com/go-kit/kit/log"
    	"github.com/go-kit/kit/sd"
    	"github.com/hashicorp/consul/api"
    	"time"
    
    	"github.com/go-kit/kit/sd/consul"
    )
    
    func main() {
    
    	apiClient, err := api.NewClient(api.DefaultConfig())
    	if err != nil {
    		panic(err)
    	}
    	client := consul.NewClient(apiClient)
    
    	instancer := consul.NewInstancer(client, log.NewNopLogger(), "db-example", []string{}, true)
    
    	events := make(chan sd.Event, 1)
    	go func() {
    		instancer.Register(events)
    	}()
    
    	go func() {
    		for event := range events {
    			fmt.Println(event.Instances)
    		}
    	}()
    
    	time.Sleep(1 * time.Hour)
    }
    

    What did you expect?

    Consul agent should not be getting spammed with hundreds of requests a second.

    What happened instead?

    Instancer spammed Consul with way too many requests and drove the CPU utilization to 100%.

    7.0.0.1:53702 latency=9.375µs 2022-02-12T18:06:20.710-0500 [DEBUG] agent.http: Request finished: method=GET url=/v1/health/service/db-example?index=155&passing=1 from=127.0.0.1:53702 latency=12.208µs 2022-02-12T18:06:20.710-0500 [DEBUG] agent.http: Request finished: method=GET url=/v1/health/service/db-example?index=155&passing=1 from=127.0.0.1:53702 latency=162.792µs 2022-02-12T18:06:20.710-0500 [DEBUG] agent.http: Request finished: method=GET url=/v1/health/service/db-example?index=155&passing=1 from=127.0.0.1:53702 latency=54.791µs

    bug 
    opened by jkratz55 1
  • Mismatch of the tutorial section of stringsvc example and its full code

    Mismatch of the tutorial section of stringsvc example and its full code

    What would you like?

    I have noticed a couple of differences between the tutorial section of the stringsvc3 example and its full source code. It is worth mentioning the differences are about different imports, or different number of parameters of a particular function. I was wondering which one is the most up to date one?

    opened by amidam 6
Releases(v0.12.0)
  • v0.12.0(Sep 23, 2021)

    A mostly procedural update to Go kit, including support for the latest version of Go, and updates for dependencies, including a long-awaited update to avoid a CVE in the JWT dependency.

    • Update for Go 1.17 (#1183) — thanks, @sagikazarmark, @ChrisHines
    • Update depedency speed (#1177) — thanks, @sagikazarmark
    • Improve code quality (#1168, #1064) — thanks, @withshubh, @sagikazarmark
    • Update hudl/fargo (#1167) — thanks, @sagikazarmark
    • Update JWT dependency (#1172) — thanks, @vovinacci
    • Replace kit/log with log ((#1173) — thanks, @ChrisHines
    • Update repo issue forms (#1169, #1166) — thanks, @sagikazarmark
    Source code(tar.gz)
    Source code(zip)
  • v0.11.0(Jul 4, 2021)

    A new release with several improvements and enhancements. The first one in a long while! Huge thanks to @sagikazarmark for putting in most of the gruntwork to make it happen! You're a superstar.

    The biggest thing: package log has been extracted to a separate repository and module, go-kit/log. This means that if you or your project was importing go-kit/kit just to get package log, you can significantly reduce your go.mod and dep graph by switching to the new module. Note that we have no current plans to alias the existing go-kit/kit/log to the new go-kit/log module and package, nor to deprecate the current package in favor of the new one. They are two distinct packages with no defined relationship to each other. This may change in the future.

    Major changes:

    Thanks to the 22 contributors who contributed to this release! 🏌️‍♂️

    Bug fixes

    • metrics/cloudwatch: log CloudWatch response error (#961) (thanks @Trane9991)
    • log: defer mutex unlocks for panic safety in SyncLogger (#974)
    • util/conn: close old connection before reconnect (#982) (thanks @chikaku)
    • log/term: fix build on GOOS=js GOARCH=wasm (#993) (thanks @mvdan)
    • transport/http/jsonrpc: move the ClientAfter calls to before the decode (#1008) (thanks @directionless)
    • sd/etcdv3: fix etcdv3 client won't return error when no endpoint is available (#1009) (thanks @wayjam)
    • metrics/generic: fix uint64 alignment (#1007) (thanks @ldez)
    • log: fix stdlibadapter when prefixed (#1036) (thanks @soven)
    • log: capture newlines in log stdlib (#1041) (thanks @SuperQ)

    Enhancements

    • metrics/cloudwatch: use batch values API for CloudWatch PutMetric data call (#960) (thanks @Trane9991)
    • log: allow to use specific logrus level in the adaptor (#962) (thanks @Trane9991)
    • transport/http: add NewExplicitClient (#971)
    • transport/http/jsonrpc: add RequestID in error body when using the DefaultErrorEncoder (#969) (thanks @esenac)
    • transport/http/jsonrpc: add Version to JSON-RPC client request (#990) (thanks @shirolimit)
    • log: add WithSuffix to append key-value pairs to those passed to Log (#992) (thanks @vinayvinay)
    • sd/consul: improve inconsistent Consul SD index handling (#999) (thanks @vinayvinay)
    • all: dependency updates (#1029, #1095, #1097, #1098, #1106, #1118, #1115, #1119, #1124) (thanks @ChrisHines, @Enrico204, @sagikazarmark)
    • tracing/opencensus: add support for JSONRPC (#1022) (thanks @ryan-lang)
    • tracing/opentracing: improve endpoint middleware options (#1072) (thanks @alebabai)
    • auth/jwt: fix repetition of the word "token" in JWT (#1070) (thanks @amidam)
    • sd/zk: replace unmaintained zk library with drop-in replacement (#1120) (thanks @sagikazarmark)
    • cmd/kitgen: remove deprecated kitgen (#1121) (thanks @sagikazarmark)

    Documentation, examples, tests

    • readme: change godoc to pkg.go.dev (#963) (thanks @relunctance)
    • readme: add links to generator tools (#964)
    • metrics/cloudwatch: fix bad Gauge test (#975) (thanks @Trane9991)
    • readme: update the link and description for go-micro (#989) (thanks @asim)
    • examples: add missing "to" preposition (#1014)
    • tracing/opencensus: fix failing tests (#1021) (thanks @ryan-lang)
    • log: fix doc comment (#1028) (thanks @vrazdalovschi)
    • ci: upgrade to the latest version of the setup-go github action (#1040) (thanks @AntonNguyen)
    • ci: update Go versions for CI (#1054, #1062) (thanks @codefromthecrypt)
    • examples: relocate examples to a separate repository (#1100) (thanks @sagikazarmark)
    • transport/awslambda: replace aws lambda structs with stubs in tests (#1117) (thanks @sagikazarmark)
    • transport/nats: fix panic in tests (#1122) (thanks @sagikazarmark)
    • tracing: add a link to opentelemetry instrumentation (#1112) (thanks @sagikazarmark)

    See more details in the 0.11.0 milestone.

    Source code(tar.gz)
    Source code(zip)
  • v0.10.0(Feb 17, 2020)

    A new release with several minor improvements and enhancements. The major change is the adoption of Go modules: Go kit now includes a go.mod (and go.sum) specifying the precise version of our dependencies. We'll try to keep these dependencies updated, but consumers can always specify overrides, if necessary.

    Thanks to the 10 contributors who contributed to this release! 🏌️‍♂️

    Bug fixes

    • dogstatsd: Drop metrics according to sample rate (#884) (thanks @martin-sucha)
    • update_deps.bash: breakfixes
    • Fix tracing tests by replacing test.com endpoint with httpbin.org (#952) (thanks @sagikazarmark)

    Enhancements

    • modules: Add initial go.mod file (#945) (thanks @ChrisHines, @sagikazarmark, @basvanbeek)
    • sd/dnssrv: Consider SRV records with port 0 as an error (#900)
    • transport: Introduce ErrorHandlerFunc (#915) (thanks @maratori)
    • log: Disable HTML escaping in JSON Logger (#914) (thanks @treuherz)
    • auth/casbin: Update imports to casbin/v2
    • tracing/opencensus: Add a span name getter to opencensus endpoint options (#948) (thanks @sagikazarmark)

    Documentation, examples, tests

    • metrics/prometheus: Fix typo: "construts" --> "constructs" (#925) (thanks @jeffwidman)
    • examples: removed mention about ServiceMiddleware (#936) (thanks @icamys)
    • examples: Clarify rate limiter expressions in addsvc example (#943) (thanks @marselester)
    • log/level: Fix typo: "thte" -> "the" (#956) (thanks @HCoban)
    Source code(tar.gz)
    Source code(zip)
  • v0.9.0(Jun 27, 2019)

    A new major release with incremental improvements and enhancements. Major features include support for AWS Lambda as a transport, and improved error handling in all transports. Thanks to the 26 contributors who contributed to this release! 🏌

    Note that this release includes breaking changes in the metrics package, please review the documentation for changes.

    Bug fixes

    • sd/etcdv3: serve the keepalive response channel (#803) (thanks @fangdingjun)
    • tracing/zipkin: swaps tested conditions (#812) (thanks @jcchavezs)
    • metrics/influx: Fix InfluxDB import path (#826) (thanks @flowchartsman)
    • kitgen: normalize backSlashes in path (#831) (thanks @obeyda)
    • sd/etcdv3: fix dead loop (#848) (thanks @zii)
    • sd/zk: fix: ProtectedEphemeralSequential in the wrong zk path (#849) (thanks @RedDragonet)
    • metrics/cloudwatch2: fix context in Send() (#857) (thanks @h8liu)
    • sd: fix data race (#865) (thanks @toffaletti)
    • tracing/opentracing: fix port assignment (#866) (thanks @kevinreed8263)
    • transport/nats: Update imports (#881) (thanks @wallyqs)
    • metrics/prometheus: fix for latest HEAD (#885)
    • metrics/dogstatsd: Drop metrics according to sample rate (#884) (thanks @martin-sucha)

    Enhancements

    • log: Support logrus.Field logger in the logrus adapter (#793) (thanks @sagikazarmark)
    • transport/amqp: Add amqp.Delivery to the request func (#802) (thanks @ValeryPiashchynski)
    • transport/http: adding request and response encoders for Protobuf (#809) (thanks @jprobinson)
    • tracing/zipkin: add request sampler (#813) (thanks @jcchavezs)
    • tracing/opentracing: Change span injection/extraction from HTTP request (#821) (thanks @nboukeffa)
    • tracing/opentracing: Use opencensus' DefaultSampler instead of AlwaysSample as default (#830) (thanks @rueian)
    • metrics: Make Send/Write Loop context aware (#837) (thanks @jlordiales)
    • transport/awslambda: add support (#815) (thanks @suekto-andreas)
    • transport/amqp: add NopResponse option (#850) (thanks @mattfung)
    • log: add a log adapter for zap.Logger (#855) (thanks @MaruHyl)
    • transport: Implement transport level error handlers (#863) (thanks @sagikazarmark)
    • transport/nats: Use given context in NATS endpoint (#876) (thanks @nsmith5)
    • metrics/cloudwatch2: Update cloudwatch2 to latest upstream API (#878) (thanks @nsmith5)

    Documentation, examples, tests

    • misc: fix a few misspellings (#797) (thanks @dvrkps)
    • examples: Replace "x/net/context" import with "context" (#810) (thanks @marselester)
    • metrics/prometheus: Fix test to accommodate new Prometheus metric output (#820)
    • kitgen: fix kitgen test in the windows (#840) (thanks @runner)
    • misc: add integration with builds.sr.ht (#842)
    • log/level: improve examples (#845)
    • misc: code improvements (#868) (thanks @sosiska)
    • sd/{etcd,etcdv3}: disable flaky integration tests (#883)
    • README: Update Gin framework homepage url (#888) (thanks @yellowmint)
    Source code(tar.gz)
    Source code(zip)
  • v0.8.0(Nov 10, 2018)

    A major release! Featuring NATS and AMPQ transports, many other smaller enhancements, and many bug fixes. Thanks to the 25 contributors who made big contributions to this release! 🏌️

    Bug fixes

    • Fix Client.Endpoint to not cancel when bufferedStream (#776) (thanks @xescugc)
    • Fix Consul SD loop exiting on EOF (#788) (thanks @kcajmagic)
    • Add backoff package and fix Consul CPU usage (#635) (thanks @nicot)
    • Fix race condition in NATS transport tests (#705) (thanks @nussjustin)
    • Fix pact test due to breaking api change (#720) (thanks @basvanbeek)
    • Add FinalizerFunc to NATS transport (#790) (thanks @kirooha)
    • Fix etcdv3 registrar tests (#724) (thanks @basvanbeek)
    • JSONRPC: add id from request to response (#742) (thanks @wangzuo)
    • Fix etcd import path (#756) (thanks @h8liu)
    • Rename 'package log' to 'log package' to fix godoc link handling. (#765) (thanks @bx2)

    Enhancements

    • NATS transport (#680) (thanks @kirooha)
    • AMQP Transport (#746) (thanks @mattfung)
    • Metrics - Influx StatsD (#664) (#688) (thanks @james-r-smith)
    • HTTPClient interface (#754) (thanks @drscre)
    • Add casbin for authorization (#787) (thanks @suekto-andreas)
    • Add logrus adapter for Logger interface (#752) (#759) (thanks @aswinmprabhu)
    • Refactor (lint/unconvert): remove base64 call returns a string (#717) (thanks @mishudark)
    • Fix function names in JWT examples (#723) (thanks @zachwalton)
    • metrics/internal/convert: use method value insetad of lambda (#767) (thanks @Quasilyte)
    • metrics/teststat: replace x = x <op> y with x <op>= y (#769) (thanks @Quasilyte)
    • Fix Prometheus tests (#789)
    • Circle 2.0 support (#749, #771)

    Documentation, examples, and testing

    • Fix minor comment typos (#687) (thanks @joe94)
    • Update README.md with English version of website (#708) (thanks @Olliepop)
    • Profilesvc docs update (#709) (thanks @wadearnold)
    • Remove redundant statements in profilesvc example (#721) (thanks @sudo-suhas)
    • Adds documentation for OpenCensus (#730) (thanks @basvanbeek)
    • Add kitgen README (#743) (thanks @ermik)
    • Adds GoBuffalo (#748) (thanks @1995parham)
    • Use newest Go releases for testing (#757) (thanks @ChrisHines)
    • Remove context in stringsvc examples 1 & 2 (#764) (thanks @bx2)
    • metrics: remove commented-out debug code (#770) (thanks @Quasilyte)
    • Delete debug.test (#777) (thanks @danp)
    Source code(tar.gz)
    Source code(zip)
  • v0.7.0(Mar 19, 2018)

    An early 2018 release, containing several exciting new enhancements. First, we now have the kitgen code generation tool, for bootstrapping new services, thanks to the tireless efforts of @nyarly. Second, we have the long-awaited JSONRPC transport, due to the tireless efforts of @rossmcf, @blainsmith, and several others. Thanks also to @senseyeio. Also, we have support for etcdv3 in package sd, and a new prototype cloudwatch package for metrics.

    Thanks to the 16 individual contributors who have contributed to this release! 🏌️‍♀️

    Bug fixes

    • transport/http: Allow multiple HTTP-Headers Server (#644) -- thanks, @klaus
    • transport/jsonrpc: Fix various errors (#673, #679) -- thanks, @rossmcf and @basvanbeek
    • tracing/zipkin: Set error tag on Zipkin HTTP error status codes (#683) -- thanks, @basvanbeek

    Enhancements

    • cmd/kitgen: Add kitgen code generator tool (#589) -- thanks, @nyarly
    • transport/jsonrpc: New package (#576) -- thanks, @rossmcf @blainsmith and @senseyeio
    • sd/etcdv3: Add support for etcdv3 (#663) -- thanks, @cabrel
    • metrics/cloudwatchv2: Add alternative cloudwatch package (#668) -- thanks, @nelz9999
    • tracing/zipkin: Add native Zipkin tracing support (#671) -- thanks, @basvanbeek
    • log: Add syslog support (#574) -- thanks, @mingan
    • transport/http: Add Server NoOpRequestDecoder (#659) -- thanks, @jdolce
    • ratelimit: Remove dependency on juju (#622) -- thanks, @nelz9999

    Documentation, examples, and testing

    • examples: Update example stringsvc (#638) -- thanks, @wadearnold
    • log: Rename sirupsen import (#682) -- thanks, @arbourd
    • misc: Updates to latest Thrift (#630, #678) -- thanks @basvanbeek
    • misc: Doc updates (#662) -- thanks, @bflanigan
    Source code(tar.gz)
    Source code(zip)
  • v0.6.0(Oct 9, 2017)

    A late-2017 release, containing mostly small enhancements and bugfixes. The biggest change not totally reflected in the changelog below is that this release includes changes to support gRPC 1.6. There are several breaking or potentially-breaking changes, including the fact that we now support only Go 1.9 and above.

    Thanks to the 18 individual contributors who have contributed to this release! :golfing_woman:

    Bug fixes

    • auth/jwt: MapClaims: improve API (#568) -- breaking change -- thanks, @litriv
    • transport/grpc: rm deprecated funcs (#598) -- potentially breaking change -- thanks, @travissalascox
    • auth/jwt: prevent concurrent reads and writes on MapClaims (#564)
    • transport/grpc: fix a swallowed error (#572) -- thanks, @alrs
    • metrics/cloudwatch: only send new counter values (#591) -- thanks, @feliksik
    • metrics/dogstatsd: fix for when to omit tag values (#602) -- thanks, @jfhamlin

    Enhancements

    • Standardize names for functions moving information to and from the context (#579) -- breaking change
    • metrics/cloudwatch: partition API requests into separate concurrent batches (#540) -- thanks, @alpeb
    • ratelimit: new adapters for x/time/rate (#582) -- thanks, @nelz9999
    • sd: add Stop method to Instancer interface (#583)
    • metrics/dogstatsd: track Gauge values, and support default values (#588) -- thanks, @jfhamlin
    • metrics/cloudwatch: improve API for specifying percentiles (#599) -- thanks, @feliksik
    • auth/basic: add BasicAuth middleware (#605) -- thanks, @DimaSalakhov
    • metrics: set unit time on Timer type (#610) -- thanks, @esenac

    Documentation, examples, and testing

    • Go kit now only supports go1.9 and above (#613) -- potentially breaking change
    • Run Coveralls on Travis (#519)
    • Update gRPC README information about protoc and streams (#557) -- thanks, @Fanatics
    • Minor documentation fixes (#561)
    • Remove some byte order marks (#571) -- thanks, @lwalen
    • metrics/cloudwatch: Small fixes to CloudWatch tests (#573) -- thanks, @alrs
    • examples/addsvc: improved package layout (#577)
    • log: improve tests (#581) -- thanks, @cam-stitt
    • examples: updated Thrift to latest Go library (#585) -- thanks, @basvanbeek
    • sd: fix TestDefaultEndpointer flake (#596)
    • sd: fix spelling in doc comment (#603) -- thanks, @elliotwms
    • examples/addsvc: fix typo in doc comments (#606) -- thanks, @gosharplite
    • metrics: fix missing comma in example code (#611) -- thanks, @daniel-garcia
    • auth/jwt: minor doc update (#617) -- thanks, @bcho
    • examples/addsvc: fix typo (#619) -- thanks, @karthikmuralidharan
    Source code(tar.gz)
    Source code(zip)
  • v0.5.0(Jun 20, 2017)

    A pre-GopherCon release, the biggest change being breaking changes to package sd. We now expose the raw instance strings from each underlying service discovery system, so that consumers can do things with them other than construct endpoints. For background, see issues #475, #403, and #209, and for the (extensive) discussion, see PR #492.

    Besides that, we just have a solid set of improvements and enhancements. See below for the full changelog. Huge thanks to Yuri Shkuro @yurishkuro for his tireless work on package sd, including dealing with my mercurial demands and frustratingly irregular schedule. And huge thanks to the 17 individual contributors who've contributed to this release! 🏌️‍♀️

    Bug fixes

    • log: Update NewSyncWriter to work with term.IsTerminal (#501) — thanks, @ChrisHines
    • metrics/prometheus: move handlers to promhttp (#497) — thanks, @kavirajk

    Enhancements

    • sd: Support push model for service discovery (#492) — thanks, @yurishkuro
    • sd: add Eureka SD implementation (#504) — thanks, @martinbaillie
    • transport/http: upgrade go1.7 ctxhttp to req.WithContext (#535) — thanks, @stanxii
    • transport/http: add client finalizer (#533) — thanks, @travissalascox
    • transport/http: make request Accept header available in context (#516)
    • transport/grpc: remove autoprefixing logic (#524) — thanks, @terinjokes
    • auth/jwt: Add *WithClaims methods to jwt middleware (#488) — thanks, @cam-stitt
    • auth/jwt: Improved error handling on jwt.NewParser (#521) — thanks, @basvanbeek
    • metrics: Cloudwatch metrics (#495) — thanks, @cam-stitt
    • log: Add TimestampFormat and TimeFormat (#514) — thanks, @ChrisHines
    • log: Add msys2/cygwin terminal detection support (#485) — thanks, @ereOn

    Documentation, examples, and testing

    • sd: test fixes (#544, #547, #548, #550) — thanks, @yurishkuro
    • log/level: Remove log.NewContext mention from log/level docs (#493) — thanks, @narqo
    • log/level: fix typo in level test cases (#520) — thanks, @SimonRichardson
    • examples/shipping: header should set before WriteHeader (#538) — thanks, @bcho
    • examples/shipping: use log.NewSyncWriter in example (#522) — thanks, @terinjokes
    • examples/addsvc: Fix typo in addsvc's doc block (#518) — thanks, @annismckenzie
    • README: Remove h2 framework from Service frameworks (#532) — thanks, @NoahZhang
    • misc: Install latest by default on Travis and update go for CircleCI (#536) — thanks, @suyash
    • misc: Use more consistent CircleCI badge (#517) — thanks, @kevgo
    Source code(tar.gz)
    Source code(zip)
  • v0.4.0(Mar 8, 2017)

    Another substantial Go kit release, with a handful of bugfixes and some major enhancements.

    We now use stdlib package context wherever possible — basically, everywhere except package transport/grpc, as gRPC still imports golang.org/x/net/context and we don't have a choice but to comply. Still, there are ways to bridge the gap: see examples/addsvc for details. This means Go kit now requires Go 1.7 or above.

    The other major changes in this release involve package log. We've removed NewContext and the Context type, preferring With and WithPrefix helper functions. Also, we've promoted the experiemental level package to package level, and deprecated the old levels package to deprecated_levels. I'm really happy with this: it's a slightly esoteric, but really clean and literate way to compose levels with Go kit's package log. Give it a shot!

    For the full changelog, see below. My enormous gratitude goes to Chris Hines @ChrisHines for his expert work on package log, and to Bas van Beek @basvanbeek for his expert work on packages tracing and transport/grpc. And huge thanks to the 22 individual contributors who've contributed to this release! 🏌️‍♀️

    Bug fixes

    • log/term/colorlogger: Reset bold attribute (#399) - thanks, @serge-v
    • metrics/influx: Fix global tags (#404) — thanks, @kihamo
    • metrics/generic: make goroutine-safe (#424) — thanks, @gaplyk
    • metrics/generic: actually track metric name thru With invocations (#455) — thanks, @yurishkuro

    Enhancements

    • Use stdlib context where possible (#421, #480)
    • log: remove Context type, prefer With/WithPrefix helpers (#481)
    • log: DefaultTimestamp becomes nano-precision (#430) — thanks, @willfaught
    • log: DefaultCaller key becomes "caller" (#439) — thanks, @willfaught
    • log/level: brand new leveled logging package (#401, #454, #470, #476) — thanks, @groob
    • metrics: Gauge gets an Add method (#393) — thanks, @hardcoar, @dlmiddlecote
    • metrics/circonus: rm :( it was racy, difficult to test, and broke often (#442)
    • sd/etcd: add TTL (#413) — thanks, @buptmiao
    • transport: ServerBefore/ServerAfter can be repeated (#467, #479) — thanks, @djgilcrease
    • transport/grpc: improve error handling (#389) — thanks, @kushtrimjunuzi
    • transport/grpc: support Server Response Headers and Trailers (#479)
    • transport/http: add ServerFinalizer (#394, #405, #408, #461) — thanks, @konradreiche, @xla, @drscre
    • transport/http: enhance ErrorEncoder: support StatusCoder, Headerer, json.Marshaler interfaces (#414)
    • transport/http: don't encode JSON response with StatusNoContent (#436) — thanks, @groob
    • transport/http: add EncodeJSONRequest helper (#440) — thanks, @willfaught
    • transport/http: add EncodeXMLRequest (#456) — thanks, and condolences, to @gaplyk

    Documentation, examples, and testing

    • examples/addsvc: correct typo (#396) — thanks, @patterns
    • examples/shipping: fix reciever name (#473) — thanks, @kisPocok
    • log: improve documentation (#429)
    • metrics: fix documentation (#406, #417) — thanks, @Artmann
    • metrics/graphite: fix typo in docs (#450) — thanks, @jkakar
    • tracing/zipkin: document new, easier Zipkin HTTP tracing collector (#466)
    • tracing/zipkin: fix typo in Zipkin docs (#469) — thanks, @frozzare
    • Testing: fixes for Go report card (#395)
    • Testing: run integration tests on Circle (#372, #416) — thanks, @rodrigosaito
    • Testing: use docker-compose 1.10 in integration environment (#448)
    • Testing: improve coverprofile wildcard in gitignore (#458) — thanks, @travissalascox
    • Testing: Drone.io is no more :( (#468) — thanks, @17twenty
    • Testing: Upgrade CI to use go1.7.5 and go1.8 (#471)
    Source code(tar.gz)
    Source code(zip)
  • v0.3.0(Nov 15, 2016)

    An incremental, if large, release of Go kit. With contributions from @basvanbeek, @bbrazil, @briankassouf, @cam-stitt, @dvrkps, @everesio, @Fenthick, @groob, @jstordeur, @kpacha, @marcusolsson, @mishudark, @peterbourgon, @rossmcf, @suyash, and @xla. Thanks, contributors!

    Bug fixes

    • Fix synchronization bug in metrics/generic.Histogram (#392)
    • Fixes tracking changes to OpenTracing (#387, #374, #339)
    • Fixes and improvements to package metrics/influx (#369)
    • Correct HTTP tags in distributed tracing spans (#375)
    • Fix some dead and breaking code in package sd/consul (#371)
    • Fix panic on inconsistent label cardinality (#365)
    • Fix To/From mixup in package tracing (#348)

    Enhancements

    • Completely refactor package metrics (#313) ★
    • Add package auth/jwt (#335)
    • Add package metrics/pcp for Intel Performance CoPilot (#363)
    • Add package log/experimental_level (#357)
    • Custom error behavior for lb.Retry (#370)
    • Update examples/shipping (#388)
    • Go Report Card fixes (#379)
    • Remove unused errors from package endpoint (#361)
    • Add metrics.Timer (#358)
    • Add better unit tests for package sd/etcd.Client (#344)

    Documentation

    • Clarify comments in package metrics (#342)
    • Fix typo in package auth/jwt docs (#385)
    • Fix typo in package log docs (#380, #351)
    • Fix typo in package metrics/expvar docs #356
    • Provide better initial guidance in package circuitbreaker docs (#345)
    Source code(tar.gz)
    Source code(zip)
  • v0.2.0(Aug 2, 2016)

    An incremental release of Go kit. With contributions from @Ayiga, @basvanbeek, @ChrisHines, @eblanchette, @ifraixedes, @jygastaud, @LennartOlsen, @peterbourgon, and @xmattstrongx. Thanks, contributors!

    Bug fixes

    • util/conn: fix Manager behavior when initial Dial fails (#293)
    • Fixes tracking changes to OpenTracing (#330, #315, #314, #311, #306)
    • Fixes and improvements to package etcd tests (#329)

    Enhancements

    • Simple sync log (#327)
    • Do not log "SpanContext not found in Extract carrier" (#316)
    • Improvements to transports and contexts, especially gRPC (#303)
    • sd etcd register/deregister implementation (#299)

    Documentation

    • Some small fixes on Profilesvc example (#318)
    • Adding testable example documention (#317)
    • Removed url.QueryEscape from the make*Endpoint functions (#309)
    • Fix typos (#307)
    • Update documentation throughout the project (#301)
    • Update client.go concatEndpoint (#297)
    • examples/addsvc: recompile protobufs (#296)
    Source code(tar.gz)
    Source code(zip)
  • v0.1.0(Jun 7, 2016)

Owner
Go kit
A Go toolkit for microservices.
Go kit
a Framework for creating microservices using technologies and design patterns of Erlang/OTP in Golang

Technologies and design patterns of Erlang/OTP have been proven over the years. Now in Golang. Up to x5 times faster than original Erlang/OTP in terms

Taras Halturin 1.9k Dec 28, 2022
Golang client library for adding support for interacting and monitoring Celery workers, tasks and events.

Celeriac Golang client library for adding support for interacting and monitoring Celery workers and tasks. It provides functionality to place tasks on

Stefan von Cavallar 73 Oct 28, 2022
dht is used by anacrolix/torrent, and is intended for use as a library in other projects both torrent related and otherwise

dht Installation Install the library package with go get github.com/anacrolix/dht, or the provided cmds with go get github.com/anacrolix/dht/cmd/....

Matt Joiner 254 Dec 28, 2022
A feature complete and high performance multi-group Raft library in Go.

Dragonboat - A Multi-Group Raft library in Go / 中文版 News 2021-01-20 Dragonboat v3.3 has been released, please check CHANGELOG for all changes. 2020-03

lni 4.5k Dec 30, 2022
Dynatomic is a library for using dynamodb as an atomic counter

Dynatomic Dynatomic is a library for using dynamodb as an atomic counter Dynatomic Motivation Usage Development Contributing Motivation The dynatomic

Tyler Finethy 15 Sep 26, 2022
Library for enabling asynchronous health checks in your service

go-health A library that enables async dependency health checking for services running on an orchestrated container platform such as kubernetes or mes

InVision 657 Jan 4, 2023
AppsFlyer 505 Dec 27, 2022
Simple, fast and scalable golang rpc library for high load

gorpc Simple, fast and scalable golang RPC library for high load and microservices. Gorpc provides the following features useful for highly loaded pro

Aliaksandr Valialkin 667 Dec 19, 2022
A library that implements the outboxer pattern in go

Outboxer Outboxer is a go library that implements the outbox pattern. Getting Started Outboxer was designed to simplify the tough work of orchestratin

Ítalo Vietro 109 Dec 16, 2022
🌧 BitTorrent client and library in Go

rain BitTorrent client and library in Go. Running in production at put.io. Features Core protocol Fast extension Magnet links Multiple trackers UDP tr

Cenk Altı 794 Dec 28, 2022
A Go library for master-less peer-to-peer autodiscovery and RPC between HTTP services

sleuth sleuth is a Go library that provides master-less peer-to-peer autodiscovery and RPC between HTTP services that reside on the same network. It w

null 361 Dec 28, 2022
An experimental library for building clustered services in Go

Donut is a library for building clustered applications in Go. Example package main import ( "context" "log" "os" // Wait for etcd client v3.4, t

David Forsythe 97 Nov 17, 2022
Go Library [DEPRECATED]

Tideland Go Library Description The Tideland Go Library contains a larger set of useful Google Go packages for different purposes. ATTENTION: The cell

Tideland 194 Nov 15, 2022
Lockgate is a cross-platform locking library for Go with distributed locks using Kubernetes or lockgate HTTP lock server as well as the OS file locks support.

Lockgate Lockgate is a locking library for Go. Classical interface: 2 types of locks: shared and exclusive; 2 modes of locking: blocking and non-block

werf 232 Dec 16, 2022
This library contains utilities that are useful for building distributed services.

Grafana Dskit This library contains utilities that are useful for building distributed services. Current state This library is still in development. D

Grafana Labs 284 Jan 2, 2023
A distributed systems library for Kubernetes deployments built on top of spindle and Cloud Spanner.

hedge A library built on top of spindle and Cloud Spanner that provides rudimentary distributed computing facilities to Kubernetes deployments. Featur

null 21 Nov 9, 2022
A distributed locking library built on top of Cloud Spanner and TrueTime.

A distributed locking library built on top of Cloud Spanner and TrueTime.

null 47 Sep 13, 2022
Raft library Raft is a protocol with which a cluster of nodes can maintain a replicated state machine.

Raft library Raft is a protocol with which a cluster of nodes can maintain a replicated state machine. The state machine is kept in sync through the u

Kalyan Akella 0 Oct 15, 2021