Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PoC uses
prometheus/client_golang
to instrument a Golang app with Prometheus metrics and serve it via HTTP, with a simple basic auth so that it's not exposed to the world.The module
github.com/prometheus/client_golang/prometheus/promhttp
is required to serve the HTTP server, and then to use different types of metrics, two more modules are necessary. For example, for a counter type, the following are required:github.com/prometheus/client_golang/prometheus
github.com/prometheus/client_golang/prometheus/promauto
With the
prometheus/client_golang
lib (and some indirect dependencies) included, the Pebble binary size increased by 2.2MB (from 7.8MB to 10MB, built with-trimpath -ldflags='-s -w'
):Without Prometheus metrics libs:
ubuntu@primary:~/work/pebble$ ls -lh ./pebble -rwxr-xr-x 1 ubuntu ubuntu 7.8M Nov 11 20:47 ./pebble
With Prometheus metrics libs:
Default metrics that come with the libs:
Further PoC will be done by implementing a basic metrics lib.