oxidecomputer / omicron

Omicron: Oxide control plane
Mozilla Public License 2.0
244 stars 36 forks source link

Make instance CPU metrics accessible to non-fleet users #6155

Open david-crespo opened 1 month ago

david-crespo commented 1 month ago

Because of #5298, oxql queries to the main endpoint require fleet viewer permissions. But we want to be able to do things like show instance CPU metrics to people with view perms on the instance (technically, the instance's project). Short of the fully general authz solution, the easiest way to hack in access is to make a one-off endpoint for this analogous to the ones we already (reluctantly) have for disk metrics and silo metrics, where we call the timeseries_query function but do a different authz check.

Currently that function includes the fleet viewer check, so we'd probably have to move that up a level.

https://github.com/oxidecomputer/omicron/blob/836d3a294f3f18b86fc2c88ded6d5c9001d259f5/nexus/src/app/metrics.rs?plain=1#L136-L147

bnaecker commented 1 month ago

I wrote up some notes here which might impact this work a bit.