liveBook · Manning

Scraping

As explained in Machine Learning Platform Engineering

Metrics scraping is the periodic retrieval of metric data from an application's exposed endpoint.

Metrics scraping periodically pulls measurements from an application's exposed endpoint and stores them in Prometheus's time-series database. This pull-based flow supports operational questions such as whether a service is up, whether latency exceeds a threshold, or whether request volume drops. section 3.5

A practical scraping setup connects four operational pieces:

  • Use Grafana for charts and Alertmanager for routing threshold-based alerts. section 3.5

FastAPI scraping endpoint

Add Prometheus middleware and expose /metrics with a route handler. Custom counters can then be incremented in application code and retrieved by Prometheus.

How Machine Learning Platform Engineering covers it

How deep it goes
Explains endpoints, instrumentation, discovery, verification, queries, dashboards, and alerts, but stops short of detailed Prometheus configuration.
Examples
Uses a FastAPI /metrics endpoint, custom counters, Kubernetes scrape annotations, Prometheus queries, and Grafana request charts.
What it assumes
Assumes an application that can expose an HTTP metrics endpoint and introduces the monitoring components needed to collect and inspect it.
What you can do after
Operate/configure a pull-based metrics pipeline and validate scraped values before visualizing or alerting on them.
How it connects
Connects application metrics with Prometheus, Grafana, PromQL, Kubernetes annotations, time-series databases, and Alertmanager.

Also explained in

Compare how 9 books explain scraping →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Machine Learning Platform Engineering. The section links point to the parts of the book it draws on.