Skip to content

Commit

Permalink
Merge pull request #48 from douglascamata/fix-thanos-metric-prefix
Browse files Browse the repository at this point in the history
Fix remaining metric with "thanos_" prefix
  • Loading branch information
metalmatze committed Apr 6, 2023
2 parents fb5482c + 5871a0f commit d1711f1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion objstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ func BucketWithMetrics(name string, b Bucket, reg prometheus.Registerer) *metric
}, []string{"operation"}),

opsFetchedBytes: promauto.With(reg).NewCounterVec(prometheus.CounterOpts{
Name: "thanos_objstore_bucket_operation_fetched_bytes_total",
Name: "objstore_bucket_operation_fetched_bytes_total",
Help: "Total number of bytes fetched from bucket, per operation.",
ConstLabels: prometheus.Labels{"bucket": name},
}, []string{"operation"}),
Expand Down
20 changes: 10 additions & 10 deletions objstore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,16 +131,16 @@ func TestDownloadUploadDirConcurrency(t *testing.T) {
`), `objstore_bucket_operations_total`))

testutil.Ok(t, promtest.GatherAndCompare(r, strings.NewReader(`
# HELP thanos_objstore_bucket_operation_fetched_bytes_total Total number of bytes fetched from bucket, per operation.
# TYPE thanos_objstore_bucket_operation_fetched_bytes_total counter
thanos_objstore_bucket_operation_fetched_bytes_total{bucket="",operation="attributes"} 0
thanos_objstore_bucket_operation_fetched_bytes_total{bucket="",operation="delete"} 0
thanos_objstore_bucket_operation_fetched_bytes_total{bucket="",operation="exists"} 0
thanos_objstore_bucket_operation_fetched_bytes_total{bucket="",operation="get"} 3
thanos_objstore_bucket_operation_fetched_bytes_total{bucket="",operation="get_range"} 0
thanos_objstore_bucket_operation_fetched_bytes_total{bucket="",operation="iter"} 0
thanos_objstore_bucket_operation_fetched_bytes_total{bucket="",operation="upload"} 0
`), `thanos_objstore_bucket_operation_fetched_bytes_total`))
# HELP objstore_bucket_operation_fetched_bytes_total Total number of bytes fetched from bucket, per operation.
# TYPE objstore_bucket_operation_fetched_bytes_total counter
objstore_bucket_operation_fetched_bytes_total{bucket="",operation="attributes"} 0
objstore_bucket_operation_fetched_bytes_total{bucket="",operation="delete"} 0
objstore_bucket_operation_fetched_bytes_total{bucket="",operation="exists"} 0
objstore_bucket_operation_fetched_bytes_total{bucket="",operation="get"} 3
objstore_bucket_operation_fetched_bytes_total{bucket="",operation="get_range"} 0
objstore_bucket_operation_fetched_bytes_total{bucket="",operation="iter"} 0
objstore_bucket_operation_fetched_bytes_total{bucket="",operation="upload"} 0
`), `objstore_bucket_operation_fetched_bytes_total`))

testutil.Ok(t, UploadDir(context.Background(), log.NewNopLogger(), m, tempDir, "/dir-copy", WithUploadConcurrency(10)))

Expand Down

0 comments on commit d1711f1

Please sign in to comment.