All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
-
BREAKING
gateway.Channel
has been renamed togateway.ServerTChannel
to distinguish between client and server TChannels. -
BREAKING
gateway.TChannelRouter
has been renamed togateway.ServerTChannelRouter
-
A new boolean flag
dedicated.tchannel.client
is introduced. When set totrue
, each TChannel client creates a dedicated connection instead of registering on the default shared server connection. Clients need not do anything as the default behaviour is to use a shared connection.(#778) -
A new field has been added to the gateway to propagate the
TChannelSubLoggerLevel
for clients with dedicated connections.
- BREAKING runtime/client_http_request.go, runtime/grpc_client.go, runtime/http_client.go, runtime/router.go, runtime/server_http_request.go, runtime/server_http_response.go, runtime/tchannel_client.go, runtime/tchannel_client_raw.go, runtime/tchannel_outbound_call.go, runtime_inbound_call.go, runtime/tchannel_server.go now uses contextLogger instead of nornal logger (#748)
- Added support for fetching multiple header values. #733.
- Set explicit import alias for github.com/uber/zanzibar/runtime in templates. #734.
- Added support for multiple header values in TestGateway utility. #737.
- Added support for variadic parameters in augmented mock clients. #731.
- Added support for grpc clients that have multiple services defined in proto. #730.
- Added support for circuit breaker, logging, and metrics similar to other protocol clients for gRPC clients (#627)
- Fixed some bugs around legacy JSON config file support (#626)
- BREAKING
NewDefaultModuleSystemWithMockHook
API changed to add option for which hooks to execute. (#638) resolve_thrift
tool will now check if the given file has the.thrift
extension. (#634)- BREAKING The
thriftRootDir
field type in application config file (build.yaml) is nowidlRootDir
since both thrift and protobuf are suppported (client idl only for now) different idl types. #728. - BREAKING The
genCodePackage
field type in application config file (build.yaml) is nowobject
with properties".thrift"
and".proto"
to support separated gen code dirs for different idl types. #728.
- Fixed some nil pointer exceptions when dereferencing optional fields. (#622)
- Added support for
MaxTimes
andMinTimes
in generated mocks. (#620) - Added support for query parameters for all HTTP methods rather than just
GET
. (#625)
- Use a single downstream TCP connection for outbound YARPC requests (when using gRPC). (#624)
- Added support for gRPC downstream clients by wrapping YARPC. (#592)
- Middlewares can be specified as default and therefore mandatory for endpoints. (#558)
- Added getter for HTTP response
Headers
. (#566) - Added support for multiple Thrift exceptions with the same status code. (#565)
- Allow users to specify an incoming header to be designated as a request UUID, and logs using the context logger will include that header as a log field. (#574)
- Endpoint and client request and response headers will be attached to log fields. (#576)
- Added support for nested lists or maps containing structs, for example
list<map<string,FooStruct>>
in type converter. (#586) - Added support for HTTP query parameters to decoded into a Thrift set, in addition to the list already supported. (#617)
- Alowed customizing the log level of the gateway logger (#597)
- HTTP 404 log messages should include the URL that did not match any route for better debugging. (#613)
- Endpoint mocks using non-standard import paths should generate with the correct import path in the mock. (#555).
- Fixed a bug with middlewares that have
/
in the name. (#556). - Mock server now uses
Shutdown
(graceful shutdown) rather thanClose
. - Test servers should listen on localhost rather than public IP address, preventing firewall warnings. (#575)
- Fixed a nil pointer exception in assigning request UUID to outgoing request when request UUID is not present. (#580)
- Mock servers fixed to search for configuration under
TEST_SRCDIR
to support running under bazel. (#587) - When serving HTTP responses, only set
Content-Type
header toapplication/json
if it is not already set, rather than unconditionally setting it, possibly overwriting it. (#604) - Fixed a bug with type converter for int16. (#610)
- Post-gen build hooks should run once per build instead of once per module instance. (#612)
- BREAKING
NewTChannelClientContext
now requires aContextExtractor
(#608) - BREAKING
NewHTTPClientContext
signature changed to support multiple Thrift services. Now requires amap[string]string
in place of a[]string
for method names. (#594) - BREAKING
build.yaml
fieldmoduleSearchPaths
API changed, instead of a list of globbing patterns it is now amap[string]string
map of class name to globbing pattern. (#542) - BREAKING It is now configurable whether to emit non-runtime metrics with
host
tag or not. Runtime config now expects the boolean fieldmetrics.m3.includeHost
to be set. Runtime metrics are always emitted withhost
tag. (#570) - BREAKING Circuit breaker metrics are now emitted with tags for the circuit breaker name rather than part of the metric name. (#595)
- BREAKING
ClientThriftConfig
struct renamed toClientIDLConfig
. Client configuration files keythriftFile
changed toidlFile
. (#618) - HTTP router changed from julienschmidt/httprouter to be built-in to avoid limitations of httprouter#6 and httprouter#175. (#605)
- Default values for downstream client headers overwrite request values rather than appending. (#551)
- Unpinned
tchannel-go
andapache/thrift
in dependencies (#554). - Mandatory header checks will now only check that a header is present rather than checking that it is non-empty (#588)
- When a HTTP client returns a 4xx or 5xx error, changed the log associated with that request to be a warning rather than info level. (#596)
- Panics in type converter should have more information as to what type caused the panic. (#611)
- Removed logger metrics since it is barely useful.
- Application configuration (e.g.
config/base.json
) can now be specified in YAML in addition to JSON (#504). Zanzibar will look for theyaml
file first, and fall back tojson
file if it does not exist. JSON static configuration support may be removed in future major releases. - Module configuration (
services/<name>/service-config.json
) can now be specified as YAML in addition to JSON (#468). - Panics in endpoints are now caught (#458). HTTP endpoints return
502
status code with a body"Unexpected workflow panic, recovered at endpoint."
. TChannel endpoints will returnErrCodeUnexpected
. - Transport specific client config structs added (
HTTPClientConfig
,TChannelClientConfig
,CustomClientConfig
) that match the JSON serialized objects inclient-config.json
for the supported client transports. - Client calls are now protected with circuit breaker (#539). Circuit breaker is enabled by default for each client, it can be disabled or fine tuned with proper configurations. It also emits appropriate metrics for monitoring/alerting.
- BREAKING All
metrics
counter and timer name has been changed and using RootScope instead of AllHostScope and PerHostScope since all parameter at name (e.g. host, env and etc) is already moved to tags.(e.g. fetch name:$service.$env.per-workers.inbound.calls.recvd is changed to fetch name:endpoint.request env:$env service:$service) - BREAKING Application packages must now export a global variable named
AppOptions
of type*zanzibar.Options
to be located at package root (the package defined inbuild.json
/build.yaml
). - BREAKING
codegen.NewHTTPClientSpec
,codegen.NewTChannelClientSpec
,codegen.NewCustomClientSpec
andcodegen.ClientClassConfig
removed (#515). - BREAKING HTTP router
runtime.HTTPRouter
methodRegister
renamed toHandle
to better unify with thenet/http
standard library. - BREAKING HTTP router type
runtime.HTTPRouter
switched from exposed concrete type to an interface type to allow changing the implementation. - BREAKING
ServerHTTPRequest.Params
type changed fromjulienschmidt/httprouter.Params
tourl.Values
from the standard library. - Application logs should use the context logger in DefaultDeps.
- Added
ContextExtractor
interface. It is part of the API for defining "extractors" or functions to pull out dynamic fields like trace ID, request headers, etc. out of the context to be used in log fields and metric tags. These can be used to pull out fields that are application-specific without adding code to zanzibar. - Zanzibar now requires
yq
to be installed, whereas it previously requiredjq
to be installed.yq
is available over PyPI (pip install yq
) and homebrew (brew install python-yq
). - Integrated with Fx in the main loop of the generated application.
- JSON static configuration support is now deprecated.
JSONFileRaw
andJSONFileName
fields ofModuleInstance
are now deprecated. When YAML configuration is used,JSONFileRaw
andJSONFileName
will be zero-valued.- Exported types like
ClientClassConfig
will have their JSON tags removed in the future. gateway.Logger
is deprecated. Applications should getContextLogger
fromDefaultDeps
instead. Internal libraries can use the unexportedgateway.logger
.
- HTTP
DELETE
methods on clients can now send a JSON payload. Previously it was silently discarded. - Fixed typo in metrics scope tag for
protocol
(wasprotocal
).
- Context logger: Added
ContextLogger
interface. This new logger interface automatically has log fields for Zanzibar-defined per-request fields likerequestUUID
to allow correlating all log messages from a given request.WithLogFields
method added toruntime
package to allow users to add their own log fields to be used by subsequent logs that use the context. The context logger is added as a new field toDefaultDependencies
.
- Removed support for Go 1.9 and added support for Go 1.11.
- Some request fields like
endpointID
will no longer be present on messages using the default logger.
- The default logger (
DefaultDependencies.Logger
) is now deprecated along with multiple related functions and public variables. The preferred way to log is now using the context logger.
- Upgraded thriftrw to v1.12.0 from v1.8.0. This adds, among other things,
Ptr()
helper methods and getters for some thriftrw-go defined structs.
- Initial release.