liveBook · Manning

Metric endpoint

As explained in Learn Docker in a Month of Lunches, Second Edition

A metrics endpoint is an interface that exposes the current measurements of a system or application in a machine-readable format.

A metric endpoint exposes an application's or system's current measurements in a machine-readable format. A monitoring tool such as Prometheus periodically pulls the endpoint, stores values with timestamps, and makes them available for inspection. section 9.1

Use a metric endpoint to connect an application or platform to monitoring:

  • Configure the Docker Engine or application to expose metrics at a reachable endpoint such as /metrics. section 9.1
  • Configure Prometheus to scrape the endpoint on a schedule and verify the target is healthy. section 9.1
  • Filter collected measurements or graph them in the Prometheus web UI. section 9.1

Application monitoring lab

Run the instrumented to-do list application, browse to its /metrics URL, and connect it to Prometheus and Grafana. A useful dashboard shows tasks created, total HTTP requests processed, and requests currently being processed. section 9.6

Prometheus has a simple web UI that you can use to find metrics and run queries.
figure

Use the Prometheus interface to find collected metrics and run queries against them. section 9.1

How Learn Docker in a Month of Lunches, Second Edition covers it

How deep it goes
Explains endpoint configuration, scraping, target verification, and querying, but does not require source-code changes.
Examples
Uses Docker's /metrics endpoint, an application's /metrics URL, Prometheus queries, and a to-do list dashboard.
What it assumes
Assumes basic Docker usage while teaching endpoint discovery, Prometheus scraping, and dashboard wiring through runnable exercises.
What you can do after
Operate Prometheus and Grafana to collect, inspect, query, and dashboard application or infrastructure measurements.
How it connects
Ties metric endpoints to Prometheus, Grafana, Docker Engine, Docker Compose, and observability.

Also explained in

Compare how 4 books explain metric endpoint →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Learn Docker in a Month of Lunches, Second Edition. The section links point to the parts of the book it draws on.