diff --git a/src/handlers/advisor/index.ts b/src/handlers/advisor/index.ts index e982ef0..782d9ce 100644 --- a/src/handlers/advisor/index.ts +++ b/src/handlers/advisor/index.ts @@ -55,7 +55,7 @@ export default async function onMessage (message: Message) { probes.advisorIssueUnknown(host_id, issues); } - probes.advisorUpdateSuccess(host_id, issues, 2); // TODO: Fix Probes + probes.advisorUpdateSuccess(message, host_id, issues, 2); // TODO: Fix Probes } catch (e) { if (e instanceof Error) { probes.advisorUpdateError(host_id, issues, e); diff --git a/src/handlers/compliance/index.ts b/src/handlers/compliance/index.ts index 975af5b..5f8f0ed 100644 --- a/src/handlers/compliance/index.ts +++ b/src/handlers/compliance/index.ts @@ -56,7 +56,7 @@ export default async function onMessage (message: Message) { probes.complianceIssueUnknown(host_id, issues); } - probes.complianceUpdateSuccess(host_id, issues, 2); // TODO: Fix Probes + probes.complianceUpdateSuccess(message, host_id, issues, 2); // TODO: Fix Probes } catch (e) { if (e instanceof Error) { probes.complianceUpdateError(host_id, issues, e); diff --git a/src/handlers/patch/index.ts b/src/handlers/patch/index.ts index 4063288..1298cca 100644 --- a/src/handlers/patch/index.ts +++ b/src/handlers/patch/index.ts @@ -55,7 +55,7 @@ export default async function onMessage (message: Message) { probes.patchIssueUnknown(host_id, issues); } - probes.patchUpdateSuccess(host_id, issues, 2); // TODO: Fix Probes + probes.patchUpdateSuccess(message, host_id, issues, 2); // TODO: Fix Probes } catch (e) { if (e instanceof Error) { probes.patchUpdateError(host_id, issues, e); diff --git a/src/handlers/vulnerability/index.ts b/src/handlers/vulnerability/index.ts index 0060471..1f7da5d 100644 --- a/src/handlers/vulnerability/index.ts +++ b/src/handlers/vulnerability/index.ts @@ -56,7 +56,7 @@ export default async function onMessage (message: Message) { probes.vulnerabilityIssueUnknown(host_id, issues); } - probes.vulnerabilityUpdateSuccess(host_id, issues, 2); // TODO: Fix Probes + probes.vulnerabilityUpdateSuccess(message, host_id, issues, 2); // TODO: Fix Probes } catch (e) { if (e instanceof Error) { probes.vulnerabilityUpdateError(host_id, issues, e); diff --git a/src/probes.ts b/src/probes.ts index 0043f53..06c31f8 100644 --- a/src/probes.ts +++ b/src/probes.ts @@ -46,6 +46,7 @@ const counters = { export function incomingMessage (topic: string, message: Message) { log.trace({ message }, 'incoming message'); + log.info({ message }, 'incoming message'); counters.incoming.labels(topic).inc(); }; @@ -98,8 +99,8 @@ export function lostUpdateMessage (message: ReceptorMessage) counters.lostMessage.inc() } -export function advisorUpdateSuccess (host_id: string, issues: string[], references: number) { - log.info({ host_id, references }, 'advisor issues successfully updated'); +export function advisorUpdateSuccess (message: Message, host_id: string, issues: string[], references: number) { + log.info({ message, host_id, references }, 'advisor issues successfully updated'); log.debug({ issues }, 'updated advisor issues'); counters.advisor.labels('success').inc(); }; @@ -124,8 +125,8 @@ export function advisorUpdateErrorParse (message: Message, err: Error) { counters.compliance.labels('error_parse').inc(); }; -export function complianceUpdateSuccess (host_id: string, issues: string[], references: number) { - log.info({ host_id, references }, 'compliance issues successfully updated'); +export function complianceUpdateSuccess (message: Message, host_id: string, issues: string[], references: number) { + log.info({ message, host_id, references }, 'compliance issues successfully updated'); log.debug({ issues }, 'updated compliance issues'); counters.compliance.labels('success').inc(); }; @@ -150,8 +151,8 @@ export function complianceUpdateErrorParse (message: Message, err: Error) { counters.compliance.labels('error_parse').inc(); }; -export function patchUpdateSuccess (host_id: string, issues: string[], references: number) { - log.info({ host_id, references }, 'patch issues successfully updated'); +export function patchUpdateSuccess (message: Message, host_id: string, issues: string[], references: number) { + log.info({ message, host_id, references }, 'patch issues successfully updated'); log.debug({ issues }, 'updated patch issues') counters.patch.labels('success').inc(); }; @@ -176,8 +177,8 @@ export function patchUpdateErrorParse (message: Message, err: Error) { counters.patch.labels('error_parse').inc(); }; -export function vulnerabilityUpdateSuccess (host_id: string, issues: string[], references: number) { - log.info({ host_id, references }, 'vulnerability issues successfully updated'); +export function vulnerabilityUpdateSuccess (message: Message, host_id: string, issues: string[], references: number) { + log.info({ message, host_id, references }, 'vulnerability issues successfully updated'); log.debug({ issues }, 'updated vulnerabilitiy issues'); counters.vulnerability.labels('success').inc(); };