Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up compactor logging after proto change #4212

Merged
merged 2 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions tempodb/compactor.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,22 @@ func (rw *readerWriter) compact(ctx context.Context, blockMetas []*backend.Block

var totalRecords int
for _, blockMeta := range blockMetas {
level.Info(rw.logger).Log("msg", "compacting block", "block", fmt.Sprintf("%+v", blockMeta))
level.Info(rw.logger).Log(
"msg", "compacting block",
"version", blockMeta.Version,
"tenantID", blockMeta.TenantID,
"blockID", blockMeta.BlockID.String(),
"startTime", blockMeta.StartTime.String(),
"endTime", blockMeta.EndTime.String(),
"totalObjects", blockMeta.TotalObjects,
"size", blockMeta.Size_,
"compactionLevel", blockMeta.CompactionLevel,
"encoding", blockMeta.Encoding.String(),
"totalRecords", blockMeta.TotalObjects,
"bloomShardCount", blockMeta.BloomShardCount,
"footerSize", blockMeta.FooterSize,
"replicationFactor", blockMeta.ReplicationFactor,
)
totalRecords += int(blockMeta.TotalObjects)

// Make sure block still exists
Expand Down Expand Up @@ -272,7 +287,7 @@ func (rw *readerWriter) compact(ctx context.Context, blockMetas []*backend.Block
time.Since(startTime),
}
for _, meta := range newCompactedBlocks {
logArgs = append(logArgs, "block", fmt.Sprintf("%+v", meta))
logArgs = append(logArgs, "blockID", meta.BlockID.String())
}
level.Info(rw.logger).Log(logArgs...)

Expand Down
17 changes: 16 additions & 1 deletion tempodb/encoding/vparquet2/compactor.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,22 @@ func (c *Compactor) finishBlock(ctx context.Context, block *streamingBlock, l lo
return fmt.Errorf("error completing block: %w", err)
}

level.Info(l).Log("msg", "wrote compacted block", "meta", fmt.Sprintf("%+v", block.meta))
level.Info(l).Log("msg", "wrote compacted block",
"version", block.meta.Version,
"tenantID", block.meta.TenantID,
"blockID", block.meta.BlockID.String(),
"startTime", block.meta.StartTime.String(),
"endTime", block.meta.EndTime.String(),
"totalObjects", block.meta.TotalObjects,
"size", block.meta.Size_,
"compactionLevel", block.meta.CompactionLevel,
"encoding", block.meta.Encoding.String(),
"totalRecords", block.meta.TotalObjects,
"bloomShardCount", block.meta.BloomShardCount,
"footerSize", block.meta.FooterSize,
"replicationFactor", block.meta.ReplicationFactor,
)

compactionLevel := int(block.meta.CompactionLevel) - 1
if c.opts.BytesWritten != nil {
c.opts.BytesWritten(compactionLevel, bytesFlushed)
Expand Down
17 changes: 16 additions & 1 deletion tempodb/encoding/vparquet3/compactor.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,22 @@ func (c *Compactor) finishBlock(ctx context.Context, block *streamingBlock, l lo
return fmt.Errorf("error completing block: %w", err)
}

level.Info(l).Log("msg", "wrote compacted block", "meta", fmt.Sprintf("%+v", block.meta))
level.Info(l).Log("msg", "wrote compacted block",
"version", block.meta.Version,
"tenantID", block.meta.TenantID,
"blockID", block.meta.BlockID.String(),
"startTime", block.meta.StartTime.String(),
"endTime", block.meta.EndTime.String(),
"totalObjects", block.meta.TotalObjects,
"size", block.meta.Size_,
"compactionLevel", block.meta.CompactionLevel,
"encoding", block.meta.Encoding.String(),
"totalRecords", block.meta.TotalObjects,
"bloomShardCount", block.meta.BloomShardCount,
"footerSize", block.meta.FooterSize,
"replicationFactor", block.meta.ReplicationFactor,
)

compactionLevel := int(block.meta.CompactionLevel) - 1
if c.opts.BytesWritten != nil {
c.opts.BytesWritten(compactionLevel, bytesFlushed)
Expand Down
16 changes: 15 additions & 1 deletion tempodb/encoding/vparquet4/compactor.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,21 @@ func (c *Compactor) finishBlock(ctx context.Context, block *streamingBlock, l lo
return fmt.Errorf("error completing block: %w", err)
}

level.Info(l).Log("msg", "wrote compacted block", "meta", fmt.Sprintf("%+v", block.meta))
level.Info(l).Log("msg", "wrote compacted block",
"version", block.meta.Version,
"tenantID", block.meta.TenantID,
"blockID", block.meta.BlockID.String(),
"startTime", block.meta.StartTime.String(),
"endTime", block.meta.EndTime.String(),
"totalObjects", block.meta.TotalObjects,
"size", block.meta.Size_,
"compactionLevel", block.meta.CompactionLevel,
"encoding", block.meta.Encoding.String(),
"totalRecords", block.meta.TotalObjects,
"bloomShardCount", block.meta.BloomShardCount,
"footerSize", block.meta.FooterSize,
"replicationFactor", block.meta.ReplicationFactor,
)

span.AddEvent("wrote compacted block")
span.SetAttributes(
Expand Down