oxidecomputer / oxidecomputer/omicron

want an API for listing all the exact alert classes a receiver is subscribed to

Open
#10,805 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

fault-management
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.quux
  • foo.bar.womble
  • foo.bar.barf
  • foo.baz.quux
  • foo.baz.norp
  • buzz.norp

and I have a receiver with the subscriptions:

  • foo.*.quux
  • foo.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

Open the contributing guide

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.