Errata

Prometheus Up & Running

Errata for Prometheus Up & Running

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".

The following errata were submitted by our customers and approved as valid errors by the author or editor.

Color key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted By Date submitted Date corrected
n/a
chapter 9, example 9-3 heading

In Chapter 9 "Containers and Kubernetes", the heading for Example 9-3 is "Example 9-3. Downloading and tesing kubectl". It should be "Example 9-3. Downloading and testing kubectl".

Luis Pugoy  Feb 16, 2021  Apr 01, 2022
PDF
Page 55
2nd paragraph in "Service instrumentation"

... called the RED method, for Requests, Errors, and Duration.

should be:

... called the RED method, for Rate, Errors, and Duration.

Tom Wilkie who has popularized RED Method said "What is RED Method" as follows in his talk at GrafanaCon EU 2018:

- Rate (the number of requests per second)
- Errors (the number of those requests that are failing)
- Duration (the amount of time those requests take)

https://grafana.com/blog/2018/08/02/the-red-method-how-to-instrument-your-services/

Kazuki Suda  Jan 17, 2019  Mar 15, 2019
PDF
Page 78
sample metrics in 4.7.3 Escaping

escaping{foo="newline \n backslash \\ double quote \" "} 1

should be:

escaping{foo="newline \\n backslash \\ double quote \" "} 1

"\n" in the value of the foo label should be escaped.

Kazuki Suda  Jan 17, 2019  Mar 15, 2019
PDF
Page 92
3rd paragraph

... would be sum by (version)(python_version).

should be:

... would be sum by (version)(python_info).

Kazuki Suda  Jan 28, 2019  Mar 15, 2019
PDF
Page 128
The 3rd paragraph

Out of the box, Prometheus 2.2.1 has support for Azure, Consul, DNS, EC2, OpenStack, File, Kubernetes, Marathon, Nerve, Serverset, and Triton service discovery...

It seems that "GCE" service discovery is missing in supported list.

Kazuki Suda  Feb 10, 2019  Mar 15, 2019
PDF
Page 140
3nd paragraph

..., puts the replacement value metrics in the team label.

should be:

..., puts the replacement value monitor in the team label.

Kazuki Suda  Jan 19, 2019  Mar 15, 2019
PDF
Page 146
example code

- source_labels: [__meta_consul_tag]

should be:

- source_labels: [__meta_consul_tags]

Kazuki Suda  Feb 17, 2019  Mar 15, 2019
PDF
Page 157
Example 9-3. Downloading and testing kubectl

">none<" should be "<none>".

hostname $ ./kubectl get services
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes ClusterIP 10.96.0.1 >none< 443/TCP 44s

Kazuki Suda  Jan 19, 2019  Mar 15, 2019
PDF
Page 171
Example10-2

The example code of "Example 10-2" doesn't exist in https://github.com/prometheus-up-and-running/examples. It seems that the correct file name fo `10/10-1-prometheus.yml` is `10/10-2-prometheus.yml`.

https://github.com/prometheus-up-and-running/examples/blob/master/10/10-1-prometheus.yml

Kazuki Suda  Feb 22, 2019  Mar 15, 2019
PDF
Page 197
2nd paragraph

While we already saw version 0.6.0 of the Consul exporter in “Consul” on page 169, ...
*1 These metrics will likely be in the 0.7.0 version of the Consul exporter.

should be:

While we already saw version 0.3.0 of the Consul exporter in “Consul” on page 169, ...
*1 These metrics will likely be in the 0.4.0 version of the Consul exporter.

In "Consul" on page 169, Consul exporter 0.3.0 is used.

Kazuki Suda  Feb 10, 2019  Mar 15, 2019
PDF
Page 219
line 10

To be more precise, at least one of the matchers in a selector must not match the
empty string. So {foo=""}, {foo!=""}, and {foo=~".*"} will return an error, while
{foo="",bar="x"} or {foo=~".+"} are permitted.

should be

To be more precise, at least one of the matchers in a selector must not match the
empty string. So {foo=""} and {foo=~".*"} will return an error, while
{foo!=""}, {foo="",bar="x"} or {foo=~".+"} are permitted.

Note from the Author or Editor:
{foo!=""} should be in the permitted list in the chapter 13 Matchers section.

Jet Feng  Aug 18, 2020  Apr 01, 2022
PDF
Page 237
example queries

avg without(instance)(0.5, rate(process_cpu_seconds_total[5m]))

should be:

avg without(instance)(rate(process_cpu_seconds_total[5m]))

Kazuki Suda  Feb 11, 2019  Mar 15, 2019
PDF
Page 273
2nd example in predict_linear

deriv(node_filesystem_free_bytes{job="node"}[1h]) * 4 * 3600
+
node_filesystem_free_bytes{job="node"}[1h]


The 'deriv' function returns an instant vector while the second clause is a range vector. Correct expression should be:

deriv(node_filesystem_free_bytes{job="node"}[1h]) * 4 * 3600
+
node_filesystem_free_bytes{job="node"}

Note from the Author or Editor:
Fix is as stated.

Oleg Glushko  Jun 17, 2021  Apr 01, 2022
PDF
Page 289
3rd paragraph

Once you have alerts firing in Promethus, ...

should be:

Once you have alerts firing in Prometheus, ...

Kazuki Suda  Feb 11, 2019  Mar 15, 2019
Page 293
First alerting rule example

`hour() > 9 < 17` should be `hour() >= 9 < 17`.

It is not correct to write "This alert will only fire from 9 a.m. to 5 p.m." about `hour() > 9 < 17`. This alert would trigger from 10 a.m, as the value of `hour()` will be 9 from 9:00:00.000 until 9:59:59.999.

I think short explanation of what I outlined above would be valuable, as this is something I encounter in alerting rules very often.

Note from the Author or Editor:
Indeed, in Chapter 18 that should be >= 9, and for consistency it should also be changed in Chapter 15.

Thomas Yates  Mar 13, 2022  Apr 01, 2022
PDF
Page 348
The last paragraph

`prometheus_rule_group_last_duration_second` should be `prometheus_rule_group_last_duration_seconds`.

Kazuki Suda  Feb 08, 2019  Mar 15, 2019
ePub
Page 439
"ln, log2, and log10" paragrapth of chapter 16

The example describes a way to compute the number of 9s of successes of an API endpoint as follows:

log10(
1 - (
sum without(instance)(rate(requests_failed_total[1h]))
/
sum without(instance)(rate(requests_total[1h]))
)
) * -1

I believe this is incorrect. The correct formula should be:

log10(
sum without(instance)(rate(requests_failed_total[1h]))
/
sum without(instance)(rate(requests_total[1h]))
) * -1

Note from the Author or Editor:
Thanks, you are correct.

Davide Pedranz  May 19, 2021  Apr 01, 2022
ePub
Page 579
Chapter 19 / Receivers / Notification Templates / CommonAnnotations

“CommonAnnotations is like CommonLabels, but for annotations. This is of very limted use. ”

Excerpt From: Brian Brazil. “Prometheus: Up & Running”. Apple Books.

Typo on limited:

"limted" -> "limited"

Note from the Author or Editor:
Fixed "limted" -> "limited"

David Dieulivol  Jun 05, 2020  Apr 01, 2022
ePub
Page 579
Chapter 19 / Receivers / Notification Templates / ExternalURL

“You can also use it to figure out which of your Alertmangers sent a notification in a clustered setup.”

Excerpt From: Brian Brazil. “Prometheus: Up & Running”. Apple Books.

Typo on AlertManagers:

"Alertmangers" -> "Alertmanagers"

Note from the Author or Editor:
"Alertmangers" -> "Alertmanagers", plus another in the previous sentence.

David Dieulivol  Jun 05, 2020  Apr 01, 2022
ePub
Page 619
Chapter 20 / Running Prometheus / Configuration Management

“Prometheus does not try to fulfull the role of configuration management”

Excerpt From: Brian Brazil. “Prometheus: Up & Running”. Apple Books.

fulfull -> fulfill

David Dieulivol  Jun 09, 2020  Apr 01, 2022
Other Digital Version
1582
This is the kindle edition. Check metrics paragraph.

In this paragraph, there is an incorrect hyphen in the words "check-metrics". It should read simply "check metrics" (no quotes, remove the hyphen)

Check Metrics
Prometheus 2.0 uses a custom parser for efficiency. So just because a /metrics can be scraped doesn’t mean that the metrics are compliant with the format. Promtool is a utility included with Prometheus that among other things can verify that your metric output is valid and perform lint checks.
curl http localhost:8000/metrics | promtool check-metrics

Brazil, Brian. Prometheus: Up & Running . O'Reilly Media. Kindle Edition.

Note from the Author or Editor:
This changed from check-metrics to check metrics with Prometheus 2.0.0, so I've updated accordingly.

Victor Grazi  Feb 14, 2021  Apr 01, 2022