Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ export class ProvingBroker implements ProvingJobProducer, ProvingJobConsumer, Pr
// notify listeners of the cancellation
if (!this.resultsCache.has(id)) {
this.logger.info(`Cancelling job id=${id}`, { provingJobId: id });
await this.#reportProvingJobError(id, 'Aborted', false);
await this.#reportProvingJobError(id, 'Aborted', false, undefined, true);
}
}

Expand Down Expand Up @@ -395,6 +395,7 @@ export class ProvingBroker implements ProvingJobProducer, ProvingJobConsumer, Pr
err: string,
retry = false,
filter?: ProvingJobFilter,
aborted = false,
): Promise<GetProvingJobResponse | undefined> {
const info = this.inProgress.get(id);
const item = this.jobsCache.get(id);
Expand Down Expand Up @@ -455,7 +456,11 @@ export class ProvingBroker implements ProvingJobProducer, ProvingJobConsumer, Pr
this.promises.get(id)!.resolve(result);
this.completedJobNotifications.push(id);

this.instrumentation.incRejectedJobs(item.type);
if (aborted) {
this.instrumentation.incAbortedJobs(item.type);
} else {
this.instrumentation.incRejectedJobs(item.type);
}
if (info) {
const duration = this.msTimeSource() - info.startedAt;
this.instrumentation.recordJobDuration(item.type, duration);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export class ProvingBrokerInstrumentation {
private activeJobs: ObservableGauge;
private resolvedJobs: UpDownCounter;
private rejectedJobs: UpDownCounter;
private abortedJobs: UpDownCounter;
private timedOutJobs: UpDownCounter;
private cachedJobs: UpDownCounter;
private totalJobs: UpDownCounter;
Expand All @@ -39,6 +40,8 @@ export class ProvingBrokerInstrumentation {

this.rejectedJobs = createUpDownCounterWithDefault(meter, Metrics.PROVING_QUEUE_REJECTED_JOBS, provingJobAttrs);

this.abortedJobs = createUpDownCounterWithDefault(meter, Metrics.PROVING_QUEUE_ABORTED_JOBS, provingJobAttrs);

this.retriedJobs = createUpDownCounterWithDefault(meter, Metrics.PROVING_QUEUE_RETRIED_JOBS, provingJobAttrs);

this.timedOutJobs = createUpDownCounterWithDefault(meter, Metrics.PROVING_QUEUE_TIMED_OUT_JOBS, provingJobAttrs);
Expand Down Expand Up @@ -72,6 +75,12 @@ export class ProvingBrokerInstrumentation {
});
}

incAbortedJobs(proofType: ProvingRequestType) {
this.abortedJobs.add(1, {
[Attributes.PROVING_JOB_TYPE]: ProvingRequestType[proofType],
});
}

incRetriedJobs(proofType: ProvingRequestType) {
this.retriedJobs.add(1, {
[Attributes.PROVING_JOB_TYPE]: ProvingRequestType[proofType],
Expand Down
5 changes: 5 additions & 0 deletions yarn-project/telemetry-client/src/metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1048,6 +1048,11 @@ export const PROVING_QUEUE_REJECTED_JOBS: MetricDefinition = {
description: 'Number of rejected proving jobs',
valueType: ValueType.INT,
};
export const PROVING_QUEUE_ABORTED_JOBS: MetricDefinition = {
name: 'aztec.proving_queue.aborted_jobs_count',
description: 'Number of aborted proving jobs',
valueType: ValueType.INT,
};
export const PROVING_QUEUE_RETRIED_JOBS: MetricDefinition = {
name: 'aztec.proving_queue.retried_jobs_count',
description: 'Number of retried proving jobs',
Expand Down
Loading