Prometheus: Up & Running: Infrastructure and Application Performance Monitoring by Brian Brazil

Prometheus: Up & Running: Infrastructure and Application Performance Monitoring by Brian Brazil

Author:Brian Brazil [Brazil, Brian]
Language: eng
Format: epub
Publisher: O'Reilly Media
Published: 2018-07-08T23:00:00+00:00


Finally, the custom collector object is instantiated and registered with the default registry, in the same way you would one of the direct instrumentation metrics:

c := ConsulCollector{} prometheus.MustRegister(c)

Exposition is performed in the usual way, which you already saw in “Go”:

http.Handle("/metrics", promhttp.Handler()) log.Fatal(http.ListenAndServe(":8000", nil))

This is, of course, a simplified example. In reality you would have some way to configure the Consul server to talk to, such as a command-line flag, rather than depending on the client’s default. You would also reuse the client between scrapes, and allow the various authentication options of the client to be specified.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.