Skip to content

Commit

Permalink
[network metrics] instance network interface metrics (#747)
Browse files Browse the repository at this point in the history
Overview
========

This is related to the ongoing work in [plumbing instance/guest
metrics](#742) through to an
oximeter producer in propolis.

Includes:
* An update to `NetworkInterfaceRequest` to include an interface_id, which is part of the request on the [sled instance in Omicron](oxidecomputer/omicron#6414).
* Within initialization, with concrete types, we create interface_ids mapping nic UUIDs => `minor` number of the device instance of viona. This is done as a Vec because it is limited in size (typically the MAX networks interfaces per VM). 
  - The device instance number matches the Kstat we'll look for.
  - We track this mapping via a type alias `NetworkInterfaceIds` which is then passed to a `track_network_interfaces_kstats` function which is part of `initialize_network_devices` and adds the target to the kstat sampler. 
* A new stats module for collecting network_interface metrics.
  - In `to_samples` we generate multiple network interface targets based on vnics per instance, appropriately updating the `interface_id`, which comes from the network interface identifiers updated in network device initialization. 
* Move kstat_types out of virtual machine-specific stats and use its mocking for other stats tests
* move stats.rs to stats/mod.rs

Dependencies
------------

- [X] oxidecomputer/omicron#6414
- [X] https://code.illumos.org/c/illumos-gate/+/3630

Thanks to @pfmooney for exposing kstats directly through the viona (VirtIO-Net) driver as part of https://code.illumos.org/c/illumos-gate/+/3630. This work would be nothing without his!
  • Loading branch information
zeeshanlakhani authored Sep 3, 2024
1 parent 9e4dd21 commit 5267be8
Show file tree
Hide file tree
Showing 17 changed files with 804 additions and 211 deletions.
52 changes: 26 additions & 26 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 19 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ oximeter = { git = "https://github.com/oxidecomputer/omicron", branch = "main" }
sled-agent-client = { git = "https://github.com/oxidecomputer/omicron", branch = "main" }

# Crucible
crucible = { git = "https://github.com/oxidecomputer/crucible", rev = "d037eeb9a56a8a62ff17266f340c011224d15146" }
crucible-client-types = { git = "https://github.com/oxidecomputer/crucible", rev = "d037eeb9a56a8a62ff17266f340c011224d15146" }
crucible = { git = "https://github.com/oxidecomputer/crucible", rev = "9d82a99058e7f4d76ccc2141dcd78e7d4730cc78" }
crucible-client-types = { git = "https://github.com/oxidecomputer/crucible", rev = "9d82a99058e7f4d76ccc2141dcd78e7d4730cc78" }

# External dependencies
anyhow = "1.0"
Expand All @@ -96,7 +96,7 @@ bitflags = "2.4"
bitstruct = "0.1"
bitvec = "1.0"
byteorder = "1"
bytes = "1.1"
bytes = "1.7.1"
camino = "1.1.6"
cargo_metadata = "0.18.1"
cc = "1.0.73"
Expand Down Expand Up @@ -164,3 +164,19 @@ tracing-subscriber = "0.3.14"
usdt = { version = "0.5", default-features = false }
uuid = "1.3.2"
zerocopy = "0.7.34"


#
# It's common during development to use a local copy of various complex
# dependencies. If you want to use those, uncomment one of these blocks.
#
# [patch."https://github.com/oxidecomputer/omicron"]
# internal-dns = { path = "../omicron/internal-dns" }
# nexus-client = { path = "../omicron/clients/nexus-client" }
# omicron-common = { path = "../omicron/common" }
# oximeter-instruments = { path = "../omicron/oximeter/instruments" }
# oximeter-producer = { path = "../omicron/oximeter/producer" }
# oximeter = { path = "../omicron/oximeter/oximeter" }
# [patch."https://github.com/oxidecomputer/crucible"]
# crucible = { path = "../crucible/upstairs" }
# crucible-client-types = { path = "../crucible/crucible-client-types" }
Loading

0 comments on commit 5267be8

Please sign in to comment.