How to Export Prometheus Metrics from Just About Anything
summary
Shows how to build real Prometheus exporters in Go and proves they work by curling metrics and configuring Prometheus to scrape them. Implements a procfs CPU exporter using io.Reader + bufio.Scanner and the Prometheus client_golang Collector interface, and an HDHomeRun exporter that dials devices with timeouts using libhdhomerun + c‑for‑go and a target query parameter. Demonstrates using ConstMetric constructors, synthetic info metrics for PromQL joins, build tags for statfs, and unit‑testable interfaces.
AI-written summary · about
chapters (23)
- 0:00Introduction
- 0:24What is Prometheus
- 3:46Building an exporter in Go
- 7:46procstat
- 8:21CPU Stats
- 9:38Slice Boundaries
- 10:37Demo
- 12:07Anonymous Structures
- 13:20Export Demo
- 14:09Hardware Metrics
- 15:27Go Client
- 15:52Communications Types
- 16:34HighLevel API
- 17:40Example Program
- 19:31Device Interface
- 19:55Testing with curl
- 20:26Prometheus configuration
- 21:19Prometheus metadata
- 21:43PrometheusQL
- 23:14StatFS
- 25:54Linux Program
- 27:10Conclusion
- 28:12Questions
related talks
41mSo Many Metrics, So Little Time: 5 Prometheus Exporter Best Practices
27mGrand Treatise of Modern Instrumentation and Orchestration
22mPrometheus instrumentation: the Practical Way
32mDemocratizing Application Monitoring with Prometheus
40mInstrumenting GO Applications
33mIntro: Prometheus
35mWhat's new in the Prometheus Ecosystem?
24mLeveraging OpenTelemetry for Your Prometheus Pipeline
