oxidecomputer / oxidecomputer/omicron
want an API for listing all the exact alert classes a receiver is subscribed to
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 572
- Forks
- 97
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 96
Description
Alert receivers can subscribe to alert classes either by the exact alert class (i.e., foo.bar.baz), or using globs (i.e. foo.*.baz, foo.**). As I discovered somewhat recently, it is possible to get the globbing wrong and be surprised when a receiver is not subscribed to the classes one expected.
The alert receiver fetch and list APIs return a list of subscriptions, which contains the subscriptions as they were provided by the user --- so if I create an alert receiver with the subscriptions foo.bar.baz and foo.*, the returned list will be ["foo.bar.baz", "foo.*"]. This is the correct behavior for the fetch and list APIs, since that's the object as it was created. However, I think it would also be useful to have an API that lists the exact alert classes to which a receiver is subscribed, including whether they were created from exact subscriptions or are through a glob. This could be useful for debugging situations where you don't know what exact classes a glob matches.
For example, if we have the alert classes:
foo.bar.quuxfoo.bar.womblefoo.bar.barffoo.baz.quuxfoo.baz.norpbuzz.norp
and I have a receiver with the subscriptions:
foo.*.quuxfoo.bar.womble**.norp
I would expect the subscribed classes API to return something like:
[
{ "class": "foo.bar.quux", "glob": "foo.*.quux" },
{ "class": "foo.bar.womble", "glob": null },
{ "class": "foo.baz.quux", "glob": "foo.*.quux" },
{ "class": "foo.baz.norp", "glob": "**.norp" },
{ "class": "buzz.norp", "glob": "**.norp" }
]
(or something like that; we could alternatively have an enum of explicit exact subscription/subscription from glob, or something).
This way, you could check that your receiver is actually subscribed to the classes you expect.
Contributor guide
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
No implementation files or tests are named. Start by tracing the alert receiver fetch and list APIs and the subscription glob-matching code, then clarify the response shape and exact-versus-glob semantics; done means an agreed API can enumerate every matching alert class and identify whether it came from an exact subscription or a glob.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- api, backend-api-design, observability
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100