Skip to content

Commit

Permalink
fix merge errors
Browse files Browse the repository at this point in the history
Signed-off-by: Yi Jin <[email protected]>
  • Loading branch information
jnyi committed Feb 16, 2024
1 parent e28f166 commit 8f6798f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
2 changes: 2 additions & 0 deletions docs/components/query-frontend.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,8 @@ Flags:
--query-frontend.forward-header=<http-header-name> ...
List of headers forwarded by the query-frontend
to downstream queriers, default is empty
--query-frontend.log-failed-queries
Log failed queries due to any reason
--query-frontend.log-queries-longer-than=0
Log queries that are slower than the specified
duration. Set to 0 to disable. Set to < 0 to
Expand Down
2 changes: 1 addition & 1 deletion docs/components/tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ Flags:
--rewrite.to-relabel-config-file=<file-path>
Path to YAML file that contains relabel configs
that will be applied to blocks
--tmp.dir="/tmp/thanos-rewrite"
--tmp.dir="/var/folders/7w/bk4g23r116j_srlrlf8_ys7r0000gp/T/thanos-rewrite"
Working directory for temporary files
--tracing.config=<content>
Alternative to 'tracing.config-file' flag
Expand Down
22 changes: 11 additions & 11 deletions pkg/block/fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (s *FetcherMetrics) ResetTx() {
}

const (
FetcherSubSys = "blocks_meta"
fetcherSubSys = "blocks_meta"

CorruptedMeta = "corrupted-meta-json"
NoMeta = "no-meta-json"
Expand All @@ -98,15 +98,15 @@ const (
// Modified label values.
replicaRemovedMeta = "replica-label-removed"

tenantLabel = "__tenant__"
defautTenant = "__unkown__"
tenantLabel = "__tenant__"
defautTenant = "__unknown__"
)

func NewBaseFetcherMetrics(reg prometheus.Registerer) *BaseFetcherMetrics {
var m BaseFetcherMetrics

m.Syncs = promauto.With(reg).NewCounter(prometheus.CounterOpts{
Subsystem: FetcherSubSys,
Subsystem: fetcherSubSys,
Name: "base_syncs_total",
Help: "Total blocks metadata synchronization attempts by base Fetcher",
})
Expand All @@ -118,25 +118,25 @@ func NewFetcherMetrics(reg prometheus.Registerer, syncedExtraLabels, modifiedExt
var m FetcherMetrics

m.Syncs = promauto.With(reg).NewCounter(prometheus.CounterOpts{
Subsystem: FetcherSubSys,
Subsystem: fetcherSubSys,
Name: "syncs_total",
Help: "Total blocks metadata synchronization attempts",
})
m.SyncFailures = promauto.With(reg).NewCounter(prometheus.CounterOpts{
Subsystem: FetcherSubSys,
Subsystem: fetcherSubSys,
Name: "sync_failures_total",
Help: "Total blocks metadata synchronization failures",
})
m.SyncDuration = promauto.With(reg).NewHistogram(prometheus.HistogramOpts{
Subsystem: FetcherSubSys,
Subsystem: fetcherSubSys,
Name: "sync_duration_seconds",
Help: "Duration of the blocks metadata synchronization in seconds",
Buckets: []float64{0.01, 1, 10, 100, 300, 600, 1000},
})
m.Synced = extprom.NewTxGaugeVec(
reg,
prometheus.GaugeOpts{
Subsystem: FetcherSubSys,
Subsystem: fetcherSubSys,
Name: "synced",
Help: "Number of block metadata synced",
},
Expand All @@ -146,7 +146,7 @@ func NewFetcherMetrics(reg prometheus.Registerer, syncedExtraLabels, modifiedExt
m.Modified = extprom.NewTxGaugeVec(
reg,
prometheus.GaugeOpts{
Subsystem: FetcherSubSys,
Subsystem: fetcherSubSys,
Name: "modified",
Help: "Number of blocks whose metadata changed",
},
Expand Down Expand Up @@ -428,12 +428,12 @@ func (f *BaseFetcher) fetchMetadata(ctx context.Context) (interface{}, error) {
for id := range ch {
meta, err := f.loadMeta(ctx, id)
numBlocks += 1
if (numBlocks%10) == 0 {
if (numBlocks % 10) == 0 {
level.Debug(f.logger).Log("msg", "loaded the metadata of a block from one goroutine",
"block", id,
"n_th_block", numBlocks,
"min_time", meta.MinTime,
"duration_hours", 1.0 * (meta.MaxTime - meta.MinTime) / 1000 / 3600,
"duration_hours", 1.0*(meta.MaxTime-meta.MinTime)/1000/3600,
)
}
if err == nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/store/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ func (s *BucketStore) addBlock(ctx context.Context, meta *metadata.Meta) (err er
level.Debug(s.logger).Log("msg", "loading new block",
"id", meta.ULID,
"min_time", meta.MinTime,
"duration_hours", 1.0 * (meta.MaxTime - meta.MinTime)/(3600*1000),
"duration_hours", 1.0*(meta.MaxTime-meta.MinTime)/(3600*1000),
"num_series", meta.Stats.NumSeries,
"num_samples", meta.Stats.NumSamples,
"num_chunks", meta.Stats.NumChunks,
Expand Down

0 comments on commit 8f6798f

Please sign in to comment.