-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
134 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Drop the entire metric producer assignment table. | ||
* | ||
* Programs wishing to produce metrics need to register with Nexus. That creates | ||
* an assignment of the producer to a collector, which is recorded in this | ||
* table. That registration is idempotent, and every _current_ producer will | ||
* register when it restarts. For example, `dpd` includes a task that registers | ||
* with Nexus, so each time it (re)starts, that registration will happen. | ||
* | ||
* With that in mind, dropping this table is safe, _because all updates are | ||
* currently offline_. The current metric producers are: | ||
* | ||
* - `dpd` | ||
* - Each `nexus` instance | ||
* - Each `sled-agent` instance | ||
* - The Propolis server for each guest Instance | ||
* | ||
* Each of this either does not exist at the time of an update, or will be | ||
* restarted afterwards. Each will re-register, and so dropping this table one | ||
* time is safe. It will be recreated in later schema upgrade files in this same | ||
* update. | ||
*/ | ||
DROP TABLE IF EXISTS omicron.public.metric_producer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* | ||
* The kind of metric producer each record corresponds to. | ||
*/ | ||
CREATE TYPE IF NOT EXISTS omicron.public.producer_kind AS ENUM ( | ||
-- A sled agent for an entry in the sled table. | ||
'sled_agent', | ||
-- A service in the omicron.public.service table | ||
'service', | ||
-- A Propolis VMM for an instance in the omicron.public.instance table | ||
'instance' | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* Recreate the metric producer assignment table. | ||
* | ||
* Note that we're adding the `kind` column here, using the new enum in the | ||
* previous update SQL file. | ||
*/ | ||
CREATE TABLE IF NOT EXISTS omicron.public.metric_producer ( | ||
id UUID PRIMARY KEY, | ||
time_created TIMESTAMPTZ NOT NULL, | ||
time_modified TIMESTAMPTZ NOT NULL, | ||
kind omicron.public.producer_kind NOT NULL, | ||
ip INET NOT NULL, | ||
port INT4 CHECK (port BETWEEN 0 AND 65535) NOT NULL, | ||
interval FLOAT NOT NULL, | ||
base_route STRING(512) NOT NULL, | ||
oximeter_id UUID NOT NULL | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* | ||
* Recreate index to support looking up a producer by its assigned oximeter | ||
* collector ID. | ||
*/ | ||
CREATE UNIQUE INDEX IF NOT EXISTS lookup_producer_by_oximeter ON omicron.public.metric_producer ( | ||
oximeter_id, | ||
id | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters