Skip to content

Instantly share code, notes, and snippets.

View fourthdimension's full-sized avatar
🏠
Working from home

Dru Vagale fourthdimension

🏠
Working from home
View GitHub Profile
@gkampitakis
gkampitakis / pino-http.ts
Created February 4, 2022 20:49
pino-http ECS compliant
import { Options, pinoHttp } from 'pino-http';
import { formatError } from '@elastic/ecs-helpers';
// Taken as it is from @elastic/ecs-pino-format
function bindings(bindingsObject: Record<string, unknown>) {
const { pid, hostname, ...ecsBindings } = bindingsObject;
if (pid !== undefined) {
ecsBindings.process = { pid };
}