Skip to content

Commit

Permalink
[datastore] Rework metric producer upsertion (oxidecomputer#6759)
Browse files Browse the repository at this point in the history
This is staged on top of oxidecomputer#6748 and is based on @bnaecker's [suggestion
on that
PR](oxidecomputer#6748 (comment)).

This changes `DataStore::producer_endpoint_create()` from "the caller
must specify the Oximeter ID they want to be assigned to the new
producer" (which required them to first list and choose an Oximeter) to
"the caller does _not_ provide an Oximeter ID, and instead we choose one
randomly in a CTE".

I don't think this _fixes_ oxidecomputer#323, per se, but maybe it reworks this area
enough that we can close it as no longer relevant?
  • Loading branch information
jgallagher authored Oct 4, 2024
1 parent 81b327d commit 62c7672
Show file tree
Hide file tree
Showing 7 changed files with 634 additions and 330 deletions.
4 changes: 3 additions & 1 deletion nexus/db-model/src/oximeter_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ use nexus_types::internal_api;
use uuid::Uuid;

/// A record representing a registered `oximeter` collector.
#[derive(Queryable, Insertable, Debug, Clone, Copy, PartialEq, Eq)]
#[derive(
Queryable, Insertable, Selectable, Debug, Clone, Copy, PartialEq, Eq,
)]
#[diesel(table_name = oximeter)]
pub struct OximeterInfo {
/// The ID for this oximeter instance.
Expand Down
Loading

0 comments on commit 62c7672

Please sign in to comment.