Skip to content

Releases: reddit/baseplate.go

v0.9.1

30 Nov 17:53
v0.9.1
Compare
Choose a tag to compare

Non-breaking changes since v0.9.0:

v0.9.0

14 Oct 23:35
v0.9.0
Compare
Choose a tag to compare

Breaking Changes:

Behavior Changes:

  • httpbp&thriftbp: The default list of retryable error codes has been updated.
  • tracing&events: The default timeout for sending to message queue has been changed to 0 (non-blocking mode).
  • log: Default Wrapper is now ErrorWithSentryWrapper, this can be changed via log.DefaultWrapper global variable.
  • log: IDLExceptionSuppressor no longer suppresses baseplate.Error with 5xx code.

Non-breaking Changes:

v0.8.3

27 May 20:58
v0.8.3
f37c58b
Compare
Choose a tag to compare

Bug fixes:

  • thriftbp: Fix a bug that WrapBaseplateError could drop additional info wrapped to baseplate.Error.

New features:

Other improvements:

  • log: No longer drop pre-init logs.

v0.8.2

06 May 18:51
v0.8.2
Compare
Choose a tag to compare

Bugfixes:

Improvements:

Doc improvements:

v0.8.1

31 Mar 17:44
v0.8.1
Compare
Choose a tag to compare

New feature:

  • Add healthcheck binary, it also comes with a library so you can build the binary in your own code instead if desired.

Other improvements:

v0.8.0

16 Mar 20:58
v0.8.0
Compare
Choose a tag to compare

Deprecated

The following are deprecated in v0.8.0 and will be removed in a future release (likely v0.9.0):

  • In metricsbp, the global CounterSampleRate config is deprecated. There's really not a reason to sample counters globally in Baseplate.go.
  • The metrics coming from span hook have been updated according to new Baseplate spec. Currently both the old one and the new one are emitting to avoid breaking dashboards, but the old ones are deprecated and will be removed in the future.
    • namespace.server.endpoint is changing to namespace.baseplate.server.latency with endpoint tag for latency, and namespace.baseplate.server.rate with endpoint and success tags for request numbers.
    • namespace.client.server.endpoint is changing to namespace.baseplate.client.latency with client and endpoint tags for latency, and namespace.baseplate.client.rate with endpoint, client, and success tags for request numbers.
    • namespace.local.name is changing to namespace.baseplate.local.latency with endpoint tag for latency, and namespace.baseplate.local.rate with endpoint and success tags for number of executions.
  • redisbp package is deprecated. Please use the new redispipebp and redisx packages instead. The redisbp package is still available for now, with changed import path to "github.com/reddit/baseplate.go/redis/deprecated/redisbp".
  • retrybp: PoolExhaustedFilter and UnrecoverableErrorFilter are deprecated. They should be replaced by RetryableErrorFilter.

Other breaking changes

  • Minimal go version has been updated to 1.16.
  • Thrift library and compiler have been upgraded to 0.14.1.
  • retry-go dependency has been upgraded to 3.0.
  • metricsbp: The args of CounterWithRate, HistogramWithRate, and TimingWithRate have been converted to a struct, and a new feature to report already sampled rate has been added. Here's a simple example:
const rate = 0.01
if randbp.ShouldSampleWithRate(rate) {
        if err := myFancyWork(); err != nil {
                metricsbp.M.CounterWithRate(metricsbp.RateArgs{
                        Name: "my.fancy.work.errors",
                        // 100% report it because we are already sampling it.
                        Rate: 1,
                        // but adjust the reporting rate to the actual sample rate.
                        AlreadySampledAt: metricsbp.Float64Ptr(rate),
                }).Add(1)
        }
}
ctx, bp, err := baseplate.New(
	context.Background(),
	baseplate.NewArgs{
		ConfigPath: *configPath,
		ServiceCfg: &cfg,
		EdgeContextFactory: edgecontext.Factory(edgecontext.Config{
			Logger: log.ErrorWithSentryWrapper(),
		}),
	},
)

Other non-breaking changes

  • thriftbp: A new counter, "pool-closed-connections", has been added to client pools.
  • retrybp: Add RetryableError interface definition and RetryableErrorFilter filter implementation. Also add support to generic thrift retryable exceptions.
  • events&tracing: Add MaxQueueSize config.
  • log: Add support for a global version tag for all logs and sentry reports. You can "stamp" the git commit hash as the version at build time by using go build -ldflags "-X github.com/reddit/baseplate.go/log.Version=$(git rev-parse HEAD)".
  • tracing: Add support for UUID trace/span ids. Support for UUID ids from downstream services are always turned on, support for generating new ids using UUID is currently opt in by the UseUUID config. You should only turn it on if you know all of your upstream services support UUID ids (Baseplate.go v0.8.0+ or Baseplate.py v2.0.0+).

v0.7.3

26 Jan 21:07
v0.7.3
Compare
Choose a tag to compare

Bug fixes

  • When we added conversion for all int64 and uint64 fields in zap to string, we introduced a bug that caused zap logging lost callers (line numbers and call stacks). This bug is fixed.

Improvements

v0.7.2

12 Jan 00:33
v0.7.2
Compare
Choose a tag to compare

Bug fixes

Other improvements

v0.7.1

08 Dec 19:56
v0.7.1
Compare
Choose a tag to compare

Notable new features

  • New kafkabp package provides kafka consumer implementations, wrapping sarama package with baseplate flavor.
  • log.Wrapper in config structs can be set directly from yaml config file now (doc).
  • thriftbp.ClientPoolConfig added Validate function to help users validate the errors in the config.
  • A new middleware, ReportPayloadSizeMetrics, has been added to thriftbp's default server middlewares. It's by default turned off and can be enabled by passing a non-zero sample rate to the config.
  • thriftbp client pool now uses THeader+TCompact protocol by default. All THeader servers should be able to detect and handle them automatically so there should not be any visible changes, but the payload on the wire should be smaller.

Other notable bug fixes and improvements:

  • metricsbp package will now batch messages together and send fewer UDP messages to statsd collector. Before it sends one UDP message per metric. The batch size can be configured via StatsdConfig.BufferSize.
    • NOTE: When using telegraf as the statsd collector, it's recommended to use telegraf v1.16.3+. Earlier version might have a bug to produce malformed metric lines triggered by this change.
  • log.Attach now can be used to add key-value pairs other than trace id to the context object.
  • filewatcher had a bug that could cause panic when opening the file failed. The bug was fixed.
  • We now auto convert all int64 and uint64 log fields to strings, to avoid loss of precision from log ingesters' json parsing.

v0.7.0

09 Oct 20:49
v0.7.0
Compare
Choose a tag to compare

Breaking changes:

  • baseplate.Serve function now takes a struct as the arg. This allows users to add additional closers to be closed before and after the server during graceful shutdown.

  • randbp.GenerateRandomString function now takes a struct as the arg. This allows users to define the minimal length of the generated random string, and easier default arg fallbacks. See example for usages.

  • In the yaml config file, the sentry part was previously misspelt as "setry", it's now corrected to "sentry". If you have customized configs in the sentry portion of your config file, you need to rename "setry" into "sentry" to make it work in new version of Baseplate.go.

  • metricsbp.Timer type's functions now return self for chaining.

Other non-breaking new features and bug fixes:

  • Added retrybp.CappedExponentialBackoff, and make it the default retry policy used by retrybp package. It's an exponential backoff retry policy with random jitter and guarantee of no overflow after large number of retries.

  • In json logging, the trace_id field is now logged as string instead of uint64. This improves compatibility against some log ingesters that has problem with numbers larger than max signed int64.

  • metricsbp.Timer added OverrideStartTime and ObserveWithEndTime functions for overriding start/end times. They are also both chainable.

  • In secrets package, using empty secret path now will produce an explicit error.

  • Across Baseplate.go libraries, you'll see better quoted string args in error messages.

  • Dependency updates on thrift and retry packages.