Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Kafka message from success log messages #308

Merged
merged 1 commit into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/handlers/advisor/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default async function onMessage (message: Message) {
probes.advisorIssueUnknown(host_id, issues);
}

probes.advisorUpdateSuccess(message, host_id, issues, 2); // TODO: Fix Probes
probes.advisorUpdateSuccess(host_id, issues, 2); // TODO: Fix Probes
} catch (e) {
if (e instanceof Error) {
probes.advisorUpdateError(host_id, issues, e);
Expand Down
2 changes: 1 addition & 1 deletion src/handlers/compliance/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default async function onMessage (message: Message) {
probes.complianceIssueUnknown(host_id, issues);
}

probes.complianceUpdateSuccess(message, host_id, issues, 2); // TODO: Fix Probes
probes.complianceUpdateSuccess(host_id, issues, 2); // TODO: Fix Probes
} catch (e) {
if (e instanceof Error) {
probes.complianceUpdateError(host_id, issues, e);
Expand Down
2 changes: 1 addition & 1 deletion src/handlers/patch/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default async function onMessage (message: Message) {
probes.patchIssueUnknown(host_id, issues);
}

probes.patchUpdateSuccess(message, host_id, issues, 2); // TODO: Fix Probes
probes.patchUpdateSuccess(host_id, issues, 2); // TODO: Fix Probes
} catch (e) {
if (e instanceof Error) {
probes.patchUpdateError(host_id, issues, e);
Expand Down
2 changes: 1 addition & 1 deletion src/handlers/vulnerability/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default async function onMessage (message: Message) {
probes.vulnerabilityIssueUnknown(host_id, issues);
}

probes.vulnerabilityUpdateSuccess(message, host_id, issues, 2); // TODO: Fix Probes
probes.vulnerabilityUpdateSuccess(host_id, issues, 2); // TODO: Fix Probes
} catch (e) {
if (e instanceof Error) {
probes.vulnerabilityUpdateError(host_id, issues, e);
Expand Down
17 changes: 8 additions & 9 deletions src/probes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ const counters = {

export function incomingMessage (topic: string, message: Message) {
log.trace({ message }, 'incoming message');
log.info({ message }, 'incoming message');
counters.incoming.labels(topic).inc();
};

Expand Down Expand Up @@ -99,8 +98,8 @@ export function lostUpdateMessage (message: ReceptorMessage<PlaybookRunUpdate>)
counters.lostMessage.inc()
}

export function advisorUpdateSuccess (message: Message, host_id: string, issues: string[], references: number) {
log.info({ message, host_id, references }, 'advisor issues successfully updated');
export function advisorUpdateSuccess (host_id: string, issues: string[], references: number) {
log.info({ host_id, references }, 'advisor issues successfully updated');
log.debug({ issues }, 'updated advisor issues');
counters.advisor.labels('success').inc();
};
Expand All @@ -125,8 +124,8 @@ export function advisorUpdateErrorParse (message: Message, err: Error) {
counters.compliance.labels('error_parse').inc();
};

export function complianceUpdateSuccess (message: Message, host_id: string, issues: string[], references: number) {
log.info({ message, host_id, references }, 'compliance issues successfully updated');
export function complianceUpdateSuccess (host_id: string, issues: string[], references: number) {
log.info({ host_id, references }, 'compliance issues successfully updated');
log.debug({ issues }, 'updated compliance issues');
counters.compliance.labels('success').inc();
};
Expand All @@ -151,8 +150,8 @@ export function complianceUpdateErrorParse (message: Message, err: Error) {
counters.compliance.labels('error_parse').inc();
};

export function patchUpdateSuccess (message: Message, host_id: string, issues: string[], references: number) {
log.info({ message, host_id, references }, 'patch issues successfully updated');
export function patchUpdateSuccess (host_id: string, issues: string[], references: number) {
log.info({ host_id, references }, 'patch issues successfully updated');
log.debug({ issues }, 'updated patch issues')
counters.patch.labels('success').inc();
};
Expand All @@ -177,8 +176,8 @@ export function patchUpdateErrorParse (message: Message, err: Error) {
counters.patch.labels('error_parse').inc();
};

export function vulnerabilityUpdateSuccess (message: Message, host_id: string, issues: string[], references: number) {
log.info({ message, host_id, references }, 'vulnerability issues successfully updated');
export function vulnerabilityUpdateSuccess (host_id: string, issues: string[], references: number) {
log.info({ host_id, references }, 'vulnerability issues successfully updated');
log.debug({ issues }, 'updated vulnerabilitiy issues');
counters.vulnerability.labels('success').inc();
};
Expand Down