Skip to content

Commit

Permalink
fix: replace examplar usage with label for app_id
Browse files Browse the repository at this point in the history
  • Loading branch information
Avram Tudor committed Nov 13, 2024
1 parent dfd19d6 commit bfac47e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions skynet/modules/monitoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
namespace=PROMETHEUS_NAMESPACE,
subsystem=PROMETHEUS_SUMMARIES_SUBSYSTEM,
buckets=[5**n for n in range(4)],
labelnames=['app_id'],
)

SUMMARY_FULL_DURATION_METRIC = Histogram(
Expand Down
2 changes: 1 addition & 1 deletion skynet/modules/ttt/summaries/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ async def update_done_job(job: Job, result: str, processor: Processors, has_fail
await db.lrem(RUNNING_JOBS_KEY, 0, job.id)

if updated_job.status != JobStatus.SKIPPED:
SUMMARY_DURATION_METRIC.observe(updated_job.computed_duration, {'app_id': updated_job.metadata.app_id})
SUMMARY_DURATION_METRIC.labels(updated_job.metadata.app_id).observe(updated_job.computed_duration)
SUMMARY_FULL_DURATION_METRIC.observe(updated_job.computed_full_duration)
SUMMARY_INPUT_LENGTH_METRIC.observe(len(updated_job.payload.text))

Expand Down

0 comments on commit bfac47e

Please sign in to comment.