v2.1.0
Features :
- We now allows custom headers to be passed to pino-loki through the
headers
options. This is useful for passing the X-Scope-OrgID header to Loki. - Support for nano timestamps has been added. See the example in the examples folder for more details.
- Added a little utility type for defining pino loki options :
import pino from 'pino'
import type { LokiOptions } from 'pino-loki'
const transport = pino.transport<LokiOptions>({
target: "pino-loki",
options: {
// ...
},
});
Fix :
- When batching mode was enabled, some logs could be lost if the main process was killed before the batch was sent. This is now fixed.
Other than that, some code has been refactored :
- Migrate to ESM
- Switch to
got
instead ofaxios
And some integration tests have been added. Logs are sent to a real loki instance and we check that they are correctly received and parsed. Will add a docker-compose file to make it easier to run the tests soon.