- Add the service itself to the context during hydration
- Take ALL hydrated objects into the req-specific version to allow more consistent referencing
- Change CorrelationId to correlationid everywhere since express headers are always lower cased
- Add request/response events to the service on swagger outbound calls to enable metrics
- Removed exported Logger class in favor of a logger property on the Service.
- Apply hydrated objects to the service while they are being hydrated (they will be a promise until they resolve to a value).
This means you can just
await service.foobar
in your hydrated object's start method to depend on another object.
- Get rid of custom time in logs in favor of plain epoch
- Add support for a "spanid" in the headers (through to logs) for distributed tracing
- Support for web projects
- Added url encoded form parsing and a static handler for "./static" to servicetype:web
- Swagger errors include URL now to provide more useful debug info
- Default timeout for swagger calls is now 20 seconds
- regex shortstop handler to make regexes from config
- Major changes to error wrapping to try and generate more useful error logs without disclosing sensitive info - blacklists certain properties like 'response'
- Put higher precision timestamps in logs to avoid logstash truncation
- Add req.gb.throwError convenience method to throw properly formatted errors to the client
- Be consistent about using the field name "c" to log correlation id
- Always call "next" in middleware handler
- Graceful shutdown: we will now interact with SIGTERM to try and drain outstanding requests before quitting
- Added a metadata server on port 3001 (by default) that will answer health requests as well as provide
npm ls
output. - Add host value to all logs from env:HOSTNAME
- Add a prometheus client for metrics and add a request metric for all requests
- Add metricsShim module that helps track any module that has "start/finish/error" events that can be discovered
- Start allocating a spanId so that hopefully we can trace request flow across services where clock may skew enough to not be a useful source of information
- Add dns shortstop handler for service resolution
- Add env_switch shortstop handler to allow env vars with either true/false defaults. env_switch:!FOO would default to true, env_switch:FOO would default to false
- Add start-server script that does most of what we normally do to run a service. This avoids similar boilerplate in your project
- Fix dur (duration) to be fractional seconds
- Add method to prometheus request metric
- Add runWithService to bring up a service, run a function, and then tear it down
- Add hostname to request logs for consistency
- REPL is now promise aware just to make life easier
- Pass service to hydration shutdown
- runWithService now passes a synthetic "req-like" object to your function that has a custom logger and service proxy
- Change spanid header to span, mostly to avoid a bug with spanid header and old services (causing a 'null ref' error)
- Provide a "req" object to repl
- Parse babelrc because of bug with babel ignores [babel/babel#4082]
- finalHandlerFactory takes a shouldRenderResponse configuration argument now, allowing you to have your own final handler that decides whether to render HTML, redirect, or whatever, while still getting logs.
- metricsShim takes logAboveMs configuration value to log the operation names of things taking more than a configurable timeout in milliseconds.
- If a hydrated module exposes a metadata function, ::3001/connections/OBJECT_NAME will return it
- Move to node 8.9 which reduces the amount of transpiling to take advantage of built in support for various things (like async/await)
- Avoid nesting errors coming from swagger clients by looking for code/domain/message on the body of the response and just passing along that data
- Allow singleMetric config on metricsShim to centralize metrics with an operation label where desired
- Log a "pre" event at the beginning of a request to aid in tracking down abandoned requests
- Use request-ip to properly get the originating client ip
- Expose requestWithContext to front superagent with metrics, error logging, and correlation id/span id support
- Update to the latest swagger-client (3.x) via configured-swagger-client. This has several breaking changes which we've tried
to ameliorate as best as possible given the ubiquity of service calls. See MIGRATION for more.
- obj is no longer present on swagger responses, body is the result of an operation. We've put an exception-throwing property in dev/test, but just echo obj to body in non-(dev|test).
- requestInterceptor takes a request argument and responseInterceptor takes a response argument, whereas it used to be "this". In requestInterceptor, it is still "this" as well as the first arg, but responseInterceptor must be updated if you use it.
- security infrastructure has changed though it shouldn't affect upstream usage
- Proper JS errors are thrown and errObj is no longer returned
- Add service metrics collection for all inter-service calls (ported down from gb-services)
- Change the way swagger errors and intercepted and decorated for more useful logs (restoring useful previous behavior)
- Add
SUPERAGENT_LOGS
environment variable that will causerequestWithContext
to log full requests (as curl commands) and responses of superagent traffic.
- Add
LOG_INCOMING_REQUEST_BODIES
andLOG_OUTGOING_RESPONSE_BODIES
environment variables that will cause bodies to be logged.
- Move to pino logging framework instead of winston - simpler configuration, better performance, simpler model
- Allow enabling
SUPERAGENT_LOGS
via config.
- Updated babel-preset and affiliated modules
- Updated babel-preset which removes the "gbTranspile" checks for non-compiled module inclusion (mostly for Webpack)
- REPL now supports
--nosubs
to disable RabbitMQ subscriptions via @gasbuddy/configured-rabbitmq-client - REPL now stores history
- The result of the last completed Promise returned to the REPL is no available as
$
- Updated superagent to v5 and updated other dependencies (no expected impact)
- Be smarter about log level for an error
- Make sure the base logger is NOT in extreme mode to avoid swallowing startup messages where there is no real volume to cause a flush
- Get updated pino with some modified options (though hopefully hidden by @gasbuddy/configured-pino)
- Get updated rest-api-support and configured-swagger-client with support for per service and per request timeouts
- Complete rewrite in Typescript targeting Node 18 or greater
- Uses res.locals and app.locals instead of req.gb.
- Uses OpenTelemetry instead of bespoke logging/tracing/metric instrumentation
- Pino seems to have flipped logging metadata arguments - what was logger.info('message', { ...stuff }) is now logger.info({ ...stuff }, 'message')
- Switch to Jest from Tap
- Move some configuration keys under "server" setting - see schema.ts for the update
- Add support for tracing using
runId
through startup options and app.locals - Add
runWithService
hook to support writing cronjobs and cli utilities - Reorganized middleware relate code
- Remove support for
runId
used to add trace_id to logs - Remove
runWithService
anduseService
hooks - Make logger customizable with additional metadata passed in args to apply to log bindings
- Use single instance of
telemetry
for app startup
- Add currentTelemetryInfo helper for callers to use current telemetry info with regards to traceId, span and traceFlags
- Update logger to ensure tracing info is injected using telemetry info if available
- Ensure outgoing service calls use a default request interceptor to pass on correlationid in headers