Skip to content

Guides

Each guide covers one task end to end. If you're new, read Core concepts first; it takes five minutes and explains sources, families, fields and objects.

Publishing

  • Provider SDK


    Create a provider, register gauges, counters and strings, serve, and shut down. Options and performance.

  • Labels, objects & strings


    Labels and With, On for per-object values, string metrics for states, and deleting series.

  • Callback metrics & collectors


    GaugeFunc, CounterFunc, StringFunc, and the Collector interface for values computed on each read.

  • Socket activation & permissions


    A .socket unit with FromActivation, socket modes and groups, and who can read your metrics.

  • Bridging Prometheus


    Publish a client_golang registry through a provider, and how its types map.

  • Bridging OpenTelemetry


    Publish an OpenTelemetry SDK reader through a provider, and how names and units map.

Consuming

  • Scraping from Go


    scrape.Scraper: options, results, errors and drops, and mapping to OpenTelemetry with otelmap.

  • Unit identity


    How each source is attributed to a unit, socket activation, and what to do when it can't be.

  • Testing


    Test providers and scrapers in go test, without systemd and without root.