Skip to content

Metric update for the Upstairs#362

Merged
leftwo merged 17 commits into
mainfrom
producemetric
Jul 1, 2022
Merged

Metric update for the Upstairs#362
leftwo merged 17 commits into
mainfrom
producemetric

Conversation

@leftwo

@leftwo leftwo commented Jun 25, 2022

Copy link
Copy Markdown
Contributor

This changes the way the upstairs handles metrics. The new way is to
provide up_main() with a ProducerRegister handle that it can use to
register whatever stats it so desires. The caller/user of up_main() is
responsible for creating a dropshot endpoint to serve the collection
requests coming from Oximeter.

Updated the client test to include a dropshot server and register with
Nexus if requested.

Removed the metric_collect and metric_register fields from CrucibleOpts
as they are now obsolete. This required updating a few other files as well.

The Volume::construct() now also takes a ProducerRegister that it will
eventually pass to up_main().

This is needed before changes in oxidecomputer/propolis#147 can go in.

This changes the way the upstairs handles metrics.  The new way is to
provide up_main() with a ProducerRegister handle that it can use to
register whatever stats it so desires.  The caller/user of up_main() is
responsible for creating a dropshot endpoint to serve the collection
requests coming from Oximeter.

Updated the client test to include a dropshot server and register with
Nexus if requested.

Removed the metric_collect and metric_register fields from CrucibleOpts
as they are now obsolete.  This required updating a few other files as well.

The Volume::construct() now also takes a ProducerRegister that it will
eventually pass to up_main().
@leftwo leftwo requested a review from jmpesp June 27, 2022 22:44

@jmpesp jmpesp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Comment thread client/src/main.rs Outdated
Comment thread client/src/stats.rs Outdated
Comment thread client/src/stats.rs
Comment thread client/src/stats.rs
Comment thread tools/show_ox_propolis.sh Outdated
Comment thread tools/show_ox_upstairs.sh Outdated
Comment thread upstairs/src/volume.rs
pub fn construct(request: VolumeConstructionRequest) -> Result<Volume> {
pub fn construct(
request: VolumeConstructionRequest,
producer_registry: Arc<Mutex<Option<ProducerRegistry>>>,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be Option<Arc<Mutex<ProducerRegistry>>> I think - it someone wants to pass None, it doesn't have to be wrapped in an arc and mutex.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to have it just an Option, but I'm passing the ProducerRegistry around on the propolis side and I was not able to get it to work without Arc Mutex. @luqmana had the same comment on the propolis side PR, and I'm going to try from the other side to see if I can detangle this and if so, I'll come back here and change it as well.

@leftwo leftwo merged commit 258f162 into main Jul 1, 2022
@leftwo leftwo deleted the producemetric branch July 1, 2022 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants