Skip to content

Commit

Permalink
Fix value type (#383)
Browse files Browse the repository at this point in the history
* Fix size logging

* Add changelog entry
  • Loading branch information
alexissellier authored Nov 30, 2020
1 parent 7da2664 commit c0cb2fa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* [BUGFIX] Frequent errors logged by compactor regarding meta not found [#327](https://github.com/grafana/tempo/pull/327)
* [BUGFIX] Fix distributors panicking on rollout [#343](https://github.com/grafana/tempo/pull/343)
* [BUGFIX] Fix ingesters occassionally double flushing [#364](https://github.com/grafana/tempo/pull/364)
* [BUGFIX] Fix S3 backend logs "unsupported value type" [#381](https://github.com/grafana/tempo/issues/381)

## v0.3.0

Expand Down
12 changes: 6 additions & 6 deletions tempodb/backend/s3/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func (rw *readerWriter) WriteBlockMeta(ctx context.Context, tracker backend.Appe
}

for i, b := range bBloom {
size, err := rw.core.Client.PutObject(
info, err := rw.core.Client.PutObject(
ctx,
rw.cfg.Bucket,
util.BloomFileName(blockID, tenantID, i),
Expand All @@ -188,10 +188,10 @@ func (rw *readerWriter) WriteBlockMeta(ctx context.Context, tracker backend.Appe
if err != nil {
return errors.Wrap(err, "error uploading bloom filter to s3")
}
level.Debug(rw.logger).Log("msg", "block bloom uploaded to s3", "shard", i, "size", size)
level.Debug(rw.logger).Log("msg", "block bloom uploaded to s3", "shard", i, "size", info.Size)
}

size, err := rw.core.Client.PutObject(
info, err := rw.core.Client.PutObject(
ctx,
rw.cfg.Bucket,
util.IndexFileName(blockID, tenantID),
Expand All @@ -202,15 +202,15 @@ func (rw *readerWriter) WriteBlockMeta(ctx context.Context, tracker backend.Appe
if err != nil {
return errors.Wrap(err, "error uploading index to s3")
}
level.Debug(rw.logger).Log("msg", "block index uploaded to s3", "size", size)
level.Debug(rw.logger).Log("msg", "block index uploaded to s3", "size", info.Size)

bMeta, err := json.Marshal(meta)
if err != nil {
return errors.Wrap(err, "error unmarshalling block meta json")
}

// write meta last. this will prevent blocklist from returning a partial block
size, err = rw.core.Client.PutObject(
info, err = rw.core.Client.PutObject(
ctx,
rw.cfg.Bucket,
util.MetaFileName(blockID, tenantID),
Expand All @@ -221,7 +221,7 @@ func (rw *readerWriter) WriteBlockMeta(ctx context.Context, tracker backend.Appe
if err != nil {
return errors.Wrap(err, "error uploading block meta to s3")
}
level.Debug(rw.logger).Log("msg", "block meta uploaded to s3", "size", size)
level.Debug(rw.logger).Log("msg", "block meta uploaded to s3", "size", info.Size)

return nil
}
Expand Down

0 comments on commit c0cb2fa

Please sign in to comment.