riverqueue / riverqueue/river

feature: add river inspector that returns various info about the system

Open
#781 4 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Go
Stars
5.7k
Forks
179
Avg merge
15h 43m
Merged PRs (30d)
13

Description

Motivation

I want to periodically upload metrics about jobs count, state, and kind.

The API that allows that would be great, but at the same time I have a workaround and I think this is a low prio issue.

API

I think about something similar as asynq inspector, but only with few methods like:

  • JobsCountByState
  • JobsCountByKind
  • etc...

This API might be utilized by riverui, because right now riverui uses its own sql queries

API dosen't need to guarantee backward compatibility as it will probably change in upcoming versions.

Possible solutions
  1. River middleware that sends telemetry data about each job.

This would work, but many projects enable sampling to reduce the cost of storing large amount of data.

  1. subscriptions

This approach requires a leader election to make sure only one instance sends data.
Btw - I think exposing a leader election as an API would be a great value added by river.

  1. Collector

This is the most common setup and collector could aggregate metrics. But if you want to keep things simple then instances send the telemetry data straight to the external service.

  1. Perioding job + sql

Right now I use periodic job and custom sql queries to fetch the data and send it once a while.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing River's subscriptions documentation and the asynq Inspector API for the proposed inspection shape. Compare those options with riverui's internal/dbsqlc SQL queries and the listed approaches for collecting job metrics. Done would require an agreed API for counts by state and kind, but the issue does not define the final scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, postgresql
Domain
api, backend, databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.