diff options
author | Jaime Martinez <jmartinez@gitlab.com> | 2020-10-01 08:03:59 +0300 |
---|---|---|
committer | Jaime Martinez <jmartinez@gitlab.com> | 2020-10-01 08:03:59 +0300 |
commit | 0f280ef9e75ceeab24722d296c78b3e6a004f981 (patch) | |
tree | 50d6359f54960b6e96d0ea43b07d720b9d630529 /metrics | |
parent | aec30ca4632f31e4921ecdc16c9f583bf57e6cbc (diff) |
Rename all zip and httprange metrics
Renames all metrics to make them easier to understand.
Adds a missing metric for number of open requests made by httprange.
Diffstat (limited to 'metrics')
-rw-r--r-- | metrics/metrics.go | 93 |
1 files changed, 53 insertions, 40 deletions
diff --git a/metrics/metrics.go b/metrics/metrics.go index 982112f1..b37d04d6 100644 --- a/metrics/metrics.go +++ b/metrics/metrics.go @@ -99,31 +99,36 @@ var ( Help: "The number of VFS operations", }, []string{"vfs_name", "operation", "success"}) - // ObjectStorageBackendReqTotal is the number of requests made to Object Storage by zip file serving + // HTTPRangeRequestsTotal is the number of requests made to a + // httprange.Resource by opening and/or reading from it. Mostly used by the + // internal/vfs/zip package to load archives from Object Storage. // Could be bigger than the number of pages served. - ObjectStorageBackendReqTotal = prometheus.NewCounterVec(prometheus.CounterOpts{ - Name: "gitlab_pages_object_storage_backend_requests_total", - Help: "The number of requests made to Object Storage by zip file serving with different status codes." + + HTTPRangeRequestsTotal = prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "gitlab_pages_httprange_requests_total", + Help: "The number of requests made by the zip VFS to a Resource with " + + "different status codes." + "Could be bigger than the number of requests served", }, []string{"status_code"}) - // ObjectStorageBackendReqDuration is the time it takes to get a response - // from Object Storage in seconds for zip file servings - ObjectStorageBackendReqDuration = prometheus.NewHistogramVec( + // HTTPRangeRequestDuration is the time it takes to get a response + // from an httprange.Resource hosted in object storage for a request made by + // the zip VFS + HTTPRangeRequestDuration = prometheus.NewHistogramVec( prometheus.HistogramOpts{ - Name: "gitlab_pages_object_storage_backend_requests_duration", - Help: "The time (in seconds) it takes to get a response from the " + - "Object Storage provider for zip file serving", + Name: "gitlab_pages_httprange_requests_duration", + Help: "The time (in seconds) it takes to get a response from " + + "a httprange.Resource hosted in object storage for a request " + + "made by the zip VFS", }, []string{"status_code"}, ) - // ObjectStorageTraceDuration Object Storage request responsiveness in - // seconds for different stages of an http request see httptrace.ClientTrace - ObjectStorageTraceDuration = prometheus.NewHistogramVec( + // HTTPRangeTraceDuration httprange requests duration in seconds for + // different stages of an http request (see httptrace.ClientTrace) + HTTPRangeTraceDuration = prometheus.NewHistogramVec( prometheus.HistogramOpts{ - Name: "gitlab_pages_object_storage_backend_httptrace_duration", - Help: "Object Storage request tracing duration in seconds for " + + Name: "gitlab_pages_httprange_trace_duration", + Help: "httprange request tracing duration in seconds for " + "different connection stages (see Go's httptrace.ClientTrace)", Buckets: []float64{0.001, 0.005, 0.01, 0.02, 0.05, 0.100, 0.250, 0.500, 1, 2, 5, 10, 20, 50}, @@ -131,11 +136,17 @@ var ( []string{"request_stage"}, ) - // ZipServingOpenArchivesTotal is the number of zip archives that have been - // opened - ZipServingOpenArchivesTotal = prometheus.NewCounterVec( + // HTTPRangeOpenRequests is the number of open requests made by httprange.Reader + HTTPRangeOpenRequests = prometheus.NewGauge(prometheus.GaugeOpts{ + Name: "gitlab_pages_httprange_open_requests", + Help: "The number of open requests made by httprange.Reader", + + }) + + // ZipOpened is the number of zip archives that have been opened + ZipOpened = prometheus.NewCounterVec( prometheus.CounterOpts{ - Name: "gitlab_pages_zip_archives_total", + Name: "gitlab_pages_zip_opened", Help: "The total number of zip archives that have been opened", }, []string{"state"}, @@ -144,34 +155,35 @@ var ( // ZipServingArchiveCache is the number of zip archive cache hits/misses ZipServingArchiveCache = prometheus.NewCounterVec( prometheus.CounterOpts{ - Name: "gitlab_pages_zip_archives_cache", - Help: "The number of zip archives cache hits", + Name: "gitlab_pages_zip_cache_requests", + Help: "The number of zip archives cache hits/misses", }, []string{"cache"}, ) - // ZipServingArchivesCurrentlyCached is the number of zip archives currently - // in the cache - ZipServingArchivesCurrentlyCached = prometheus.NewGauge( + // ZipCachedArchives is the number of zip archives currently in the cache + ZipCachedArchives = prometheus.NewGauge( prometheus.GaugeOpts{ - Name: "gitlab_pages_zip_archives_currently_cached", + Name: "gitlab_pages_zip_cached_archives", Help: "The number of zip archives currently in the cache", }, ) - // ZipServingFilesPerZipArchiveCurrentlyCached ... - ZipServingFilesPerZipArchiveCurrentlyCached = prometheus.NewGauge( + // ZipArchiveEntriesCached is the number of files per zip archive currently + // in the cache + ZipArchiveEntriesCached = prometheus.NewGauge( prometheus.GaugeOpts{ - Name: "gitlab_pages_files_per_zip_archive_currently_cached", - Help: "The number of object storage zip archives currently in the cache", + Name: "gitlab_pages_zip_archive_entries_cached", + Help: "The number of files per zip archive currently in the cache", }, ) - // ZipServingFilesPerArchiveTotalCount over time - ZipServingFilesPerArchiveTotalCount = prometheus.NewCounter( + // ZipOpenedEntriesCount is the number of files per archive total count + // over time + ZipOpenedEntriesCount = prometheus.NewCounter( prometheus.CounterOpts{ - Name: "gitlab_pages_files_per_zip_archive_total", - Help: "The number of files per zip archive total count", + Name: "gitlab_pages_zip_opened_entries_count", + Help: "The number of files per zip archive total count over time", }, ) ) @@ -194,13 +206,14 @@ func MustRegister() { DiskServingFileSize, ServingTime, VFSOperations, - ObjectStorageBackendReqTotal, - ObjectStorageBackendReqDuration, - ObjectStorageTraceDuration, - ZipServingOpenArchivesTotal, - ZipServingFilesPerArchiveTotalCount, + HTTPRangeRequestsTotal, + HTTPRangeRequestDuration, + HTTPRangeTraceDuration, + HTTPRangeOpenRequests, + ZipOpened, + ZipOpenedEntriesCount, ZipServingArchiveCache, - ZipServingFilesPerZipArchiveCurrentlyCached, - ZipServingArchivesCurrentlyCached, + ZipArchiveEntriesCached, + ZipCachedArchives, ) } |