Documentation
¶
Overview ¶
Package sysmscrape is the scraper-side glue of the system-metrics plane: it wires the /proc- and /sys-reading collectors (public/observability/sysmetrics) to a sysmetricsbus Producer.
It is deliberately a separate package from sysmetricsbus so that the bus package stays free of collector imports (ADR-0090 SD6): a pure subscriber (apps/imztop) imports sysmetricsbus for its Consumer/Codec and pulls in no /proc reader, while only the components that actually scrape — the carousel host's co-located producer, the standalone sysmetricsd command, the screenshot tour, and tests — import sysmscrape.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StartScraper ¶
func StartScraper(ctx context.Context, bus app.BusI, hostToken string, interval time.Duration, logg zerolog.Logger) (stop func() (err error), err error)
StartScraper builds the default collector bundle and runs a sysmetricsbus Producer that publishes to bus under the bundle subject at the given cadence; it returns a stop func that halts the loop and closes the bundle.
It is the one place the producer (the /proc reader) is wired, so consumers like imztop can stay pure subscribers (ADR-0090). Callers supply the transport via bus: the standalone sysmetricsd command passes a natsbus client; co-located contexts (the carousel host, the screenshot tour, tests) pass an inprocbus client minted with a sysmetrics.> publish cap. hostToken scopes the subject (BundleSubject); interval ≤ 0 uses sysmetricsbus.DefaultInterval.
GPU note: DefaultBundleOptions wires the vendor-build-tag GPU collector, so GPU rides here too on a tagged build.
Types ¶
This section is empty.