feature: add river inspector that returns various info about the system
Nobody has claimed this yet.
- 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
- 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.
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.
- 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.
- 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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