Support exporting metrics from containerd-stargz-grpc
#288
+221
−5
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.
Fixes: #271
This commit adds a metrics endpoint for exporting some useful data generated by the snapshotter.
They can be pulled by prometheus.
This commit exports the following data generated by each layer of the filesystem.
We can add more metrics if needed.
stargz_fs_layer_size_bytes
(counter) : The size of the layer in bytesstargz_fs_layer_fetched_size_bytes
(counter) : The size of the fetched data of the layer in bytesEach metric is labeled by the following information to distinguish each other.
digest
: digest of the layermountpoint
: mountpoint where the layer is mountedHow to use
Specify the arbitrary address to export metrics by configuring
/etc/containerd-stargz-grpc/config.toml
.The metrics can get via
/metrics
API of that endpoint.For example, when we execute
ctr-remote i rpull ghcr.io/stargz-containers/python:3.7-esgz
, we get the following metrics:Prometheus can pull metrics from this endpoint.
Make prometheus recognize that endpoint by configuring
/etc/prometheus/prometheus.yml
:We can see the metrics on the dashboard: