Skip to Main Content
The DevOps 2.2 Toolkit
book

The DevOps 2.2 Toolkit

by Viktor Farcic
March 2018
Intermediate to advanced content levelIntermediate to advanced
360 pages
7h 52m
English
Packt Publishing
Content preview from The DevOps 2.2 Toolkit

Instrumenting services using histograms and summaries

When compared with counters and gauges, histograms are much more complex. That does not mean that they are harder to implement but that the data they provide is less simple when compared with the other metric types we explored. We'll comment on them by studying a sample code and the output it provides.

We'll switch from the vfarcic/docker-flow-swarm-listener (https://github.com/vfarcic/docker-flow-swarm-listener) repository to vfarcic/go-demo (https://github.com/vfarcic/go-demo) since it provides a simple example of a histogram.

Just as with the other types of metrics, histogram also needs to be declared as a variable of the particular type:

var (    histogram = prometheus.NewHistogramVec(prometheus.HistogramOpts{ ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

The DevOps 2.4 Toolkit

The DevOps 2.4 Toolkit

Viktor Farcic

Publisher Resources

ISBN: 9781788991278Supplemental Content