Changelog
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.
v8.0.1 - 2024-08-06
Fixed
- included HEAD method on exposed OpenAPI documentation
v8.0.0 - 2024-07-04
Added
- introduce new cli option to enable/disable the generation of endpoints OpenAPI specification. By default this option
is set to
trueto retain the previous behavior
BREAKING
- dropped node 16 support
Updated
- @opentelemetry/auto-instrumentations-node: 0.48.0
v7.1.0 - 2023-02-16
Added
- add custom log level
v7.0.4 - 2023-02-09
Changed
- bump
opentelemetrysdk version tov0.48.0 - update documentation
v7.0.3 - 2023-11-30
Added
- add support to Node 20
Updated
- upgrade dependencies
v7.0.2 - 2023-10-09
Fixed
- fix fastify.close function undefined
v7.0.1 - 2023-07-19
Updates
- remove HEAD method by default on exposed OpenAPI documentation
- upgrade dependencies
v7.0.0 - 2023-05-11
In this version, is added the support for Fastify v4. To upgrade, read the migration guide.
Metrics options
Metrics options are changed. Below there are the main changes. For other configuration, see here.
enableDefaultMetrics: boolean-->defaultMetrics: {enabled: boolean}pluginName-->nameenableRouteMetrics-->routeMetrics.enabled: booleangroupStatusCodes-->routeMetrics.groupStatusCodesinvalidRouteGroup-->invalidRouteGroup(default changed from undefined to unknown)- histogram and summary are moved under
routeMetrics.overrides blacklist-->routeMetrics.routeBlacklistprefix-->defaultMetrics.prefix
Remove node 14 support
node 14 and below are not supported. If you want to use this version of lc39, upgrade node to version 16 and above
Export lc39 as the main function
Export lc39 as the main function exported by the package. This brings two big changes:
- options are internally merged in one single object. See the merge precedence.
- the default exported logLevel is not set to
silentby default: this because it is not used only for tests
Changes
-
exported lc39 function remove the default log level set to silent, and it is now set to info. This is required since it is possible to configure lc39 also from function and not only from CLI
-
forceCloseConnectionsis set to 'idle' from false in node 18. This means that idle requests are destroyed on server close -
remove errorHandler option as unsupported by fastify-sensible
-
migrated
@fastify/swaggertov8, so that@fastify/swagger-uipackage is now required to continue exposing Swagger UI -
upgraded fastify plugins to support latest fastify version
-
upgraded library dependencies
-
when you handle streams when using async-await you will need to return or await the reply object:
fastify.get('/streams', async function (request, reply) {
const fs = require('fs')
const stream = fs.createReadStream('some-file', 'utf8')
reply.header('Content-Type', 'application/octet-stream')
return reply.send(stream)
})
Added
- add custom error serializer in log for the field
error - add tracing instrumentation with OpenTelemetry in experimental
- export lc39 options
v7.0.0-rc.0 - 2022-07-06
In this version, is added the support for Fastify v4. To upgrade, read the migration guide.
Breaking changes
Metrics options
Metrics options are changed. Below there are the main changes. For other configuration, see here.
enableDefaultMetrics: boolean-->defaultMetrics: {enabled: boolean}pluginName-->nameenableRouteMetrics-->routeMetrics.enabled: booleangroupStatusCodes-->routeMetrics.groupStatusCodesinvalidRouteGroup-->invalidRouteGroup(default changed from undefined to unknown)- histogram and summary are moved under
routeMetrics.overrides blacklist-->routeMetrics.routeBlacklist
Changed
- migrated
@fastify/swaggertov8, so that@fastify/swagger-uipackage is now required to continue exposing Swagger UI - upgraded fastify plugins to support latest fastify version
- upgraded library dependencies
Changed
- SERVICE_PREFIX now supports path without trailing slash
Removed
- remove
make-promises-safesince support of node 14 is removed
v6.0.3 - 2022-09-29
Added
- added new redact
authorization&cookielogs
v6.0.2 - 2022-06-28
Fixed
- fix empty ref resolver (#213)[https://github.com/mia-platform/lc39/pull/213]
v6.0.1 - 2022-06-07
Removed
- removed math.round from timestampFunction
Fixed
- type definitions
v6.0.0 - 2022-05-04
BREAKING CHANGES
-
dropped support to node v10.x, v12.x
-
upgrade dependencies
- metrics: upgrade fastify-metrics to v8 (from v7) and prom-client to v14 (from v13).
- env vars: upgrade dotenv to v16 (from v8) and dotenv-expand to v8 (from v5).
- expose API docs: fastify-swagger to @fastify/swagger v6 (from v4)
- changed
transformSchemaForSwaggerfunction interface (input and output params) to be equal to the transform interface exposed by@fastify/swagger.
Before:
module.exports.transformSchemaForSwagger = (schema) => {
const {
querystring,
...rest
}
const converted = {...rest}
if (querystring) {
converted.querystring = convertQuerystringSchema(querystring)
}
return converted
}After:
module.exports.transformSchemaForSwagger = ({schema, url}) => {
const {
querystring,
...rest
}
const converted = {...rest}
if (querystring) {
converted.querystring = convertQuerystringSchema(querystring)
}
return {
schema: converted,
url
}
}
Changed
- change fastify-sensible --> @fastify/sensible
Test
- Add CI workflow to support node v16 and v18
Fixes
- Fixed typos and changed docs links inside
docsdirectory - fix log schema
Updates
- update dev dependencies
v5.1.0 - 2022-02-15
Added
- Naming convention of shared schemas can be customized using the option
oasRefResolverwith the functionbuildLocalReference. If the option is not exported, thefastify-swaggerdefault is used.
v5.0.0 - 2021-08-24
Added
- Support for OpenAPI 3
Changed
- Restricted
logLeveltype fromstringto'info' | 'error' | 'debug' | 'fatal' | 'warn' | 'trace'
BREAKING CHANGES
- The used OpenAPI version is picked from the service option
openApiSpecificationinsideswaggerDefinition. Values can be'swagger'forSwagger 2.0'openapi'forOpenAPI 3- if the option is not specified,
OpenAPI 3is default
Fixed
- set the log level of route
/-/metricsequal to the status routes
v4.2.0 - 2021-07-29
Added
- added metrics options to pass to fastify-metrics
v4.1.0 - 2021-07-20
Added
- new fields params in
urlfield in incoming request and request completed logs - add additional information to response logs
v4.0.0 - 2021-04-20
BREAKING CHANGES
- fastify to v3.14.2. You can see all the breaking changes in the new fastify version here
- update prom-client to v13
- flag
--optionsand--addressare no more supported
Added
- log timestamp has precision in milliseconds instead of seconds.
Updated
- commander to v7.2.0
- fastify-metrics to v7.1.0
- fastify-plugin to v3.0.0
- fastify-sensible to v3.1.1
- fastify-swagger to v4.6.0
v4.0.0-rc.0 - 2020-12-21
BREAKING CHANGES
- fastify to v3.9.2. You can see all the breaking changes in the new fastify version here
Updated
- commander to v6.2.0
- fastify-metrics to v6.0.3
- fastify-plugin to v3.0.0
- fastify-sensible to v3.1.0
- fastify-swagger to v3.5.0
v3.2.0 - 2020-11-13
Added
- added transformSchemaForSwagger to edit schema used by swagger
v3.1.4 - 2020-10-08
Fixed
- log http.response.body.bytes should be of type int. Fixed and added test cases, also added json schema validation and logs documentation.
v3.1.3 - 2020-10-02
Fixed
- added forwardedHostname and modified other wrong log values
v3.1.2 - 2020-09-29
Fixed
- replaced
reply.res.getHeader('content-length')withreply.getHeader('content-length')in order to getcontent-lengthheader.
3.1.1 - 2020-09-22
Fixed
- moved userAgent property inside of request property. This is a breaking change in the log format, but we will handle this as a bug.
v3.1.0 - 2020-07-14
Added
- Feature flag for prometheus integration
v3.0.0 - 2020-07-10
BREAKING CHANGES
- Dropped support to Node 8
- Request and response logged information are now compliant with Mia-Platform logging guidelines. To see the guidelines, please check Mia Platform Docs. You can find the implementation details here.
Added
- Support to
streamoption to support log intercepting during tests - Integrate Prometheus
Changed
- Update commander 2.20.0 -> 3.0.2
- Update dotenv 8.0.0 -> 8.2.1
- Update fastify 2.11.0 -> 2.12.1
- Update fastify-plugin 1.6.0 -> 1.6.1
- Update fastify-swagger 2.4.0 -> 2.5.1
- Update make-promises-safe 5.0.0 -> 5.1.0
v2.4.0 - 2020-01-31
Added
- Added default
return503OnClosing: falseoption to Fastify - Added
SIGTERMsignal handler
Changed
- Update fastify 2.7.1 -> 2.11.0
v2.3.0 - 2019-11-21
Changed
- Updated status routes log level to error instead of silent (unless silent is provided from configuration).
v2.2.2 - 2019-08-08
- Update fastify 2.6.0 -> 2.7.1
v2.2.1 - 2019-07-08
Changed
- Update fastify 2.5.0 -> 2.6.0
v2.2.0 - 2019-06-20
Added
- Add
/-/check-upstatus endpoint
Changed
- Update fastify-sensible 2.0.1 -> 2.1.1
- Update fastify 2.4.1 -> 2.5.0
- Update fastify-plugin 1.5.0 -> 1.6.0
v2.1.2 - 2019-05-22
Changed
- Update fastify 2.3.0 -> 2.4.1
- Update fastify-swagger 2.3.2 -> 2.4.0
- New eslint configuration
v2.1.1 - 2019-05-03
Changed
- Update fastify 2.2.0 -> 2.3.0
- Update dotenv 7.0.0 -> 8.0.0
v2.1.0 - 2019-04-17
Added
- Add default
bodyLimitparameter tofastify
v2.0.0 - 2019-04-11
Added
- Add typescript definitions
Changed
- The exported module will create a
fastifyinstace that is not listening on any port.
v1.1.0 - 2019-04-10
Added
- Add
errorHandleroptions for customizefastify-sensibleauto handling of non caught errors
v1.0.0 - 2019-04-09
Added
- Add
fastify-sensibleplugin integration
v0.4.0 - 2019-04-08
Added
- Add
/documentation/route viafastify-swagger
Changed
- Update commander 2.19.0 -> 2.20.0
- Update dotenv 6.2.0 -> 7.0.0
- Update dotenv-expand 4.2.0 -> 5.1.0
- Update fastify 1.14.0 -> 2.2.0
- Update fastify-plugin 1.4.0 -> 1.5.0
- Update make-promises-safe 4.0.0 -> 5.0.0
- Update eslint 5.14.1 -> 5.16.0
- Update tap 12.5.3 -> 12.6.1
- Use directly eslint-config-mia without standard-mia engine
- Use the
fastifyembedded version ofpino
v0.3.0 - 2019-02-06
Changed
- Fixed
ENVinjection intestLaunchfunction - Fixed override of default values in
testLaunchfunction - Relicensed under Apache 2.0 from MIT
v0.2.0 - 2019-01-16
Added
- Add
/-/healthz and/-/readystatus endpoints.
v0.1.0 - 2019-01-08
- Initial release