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

Include additional detail when searching for traces #916

Merged
merged 1 commit into from
Aug 30, 2021
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## main / unreleased

* [ENHANCEMENT] Make s3 backend readError logic more robust [#905](https:/grafana/tempo/pull/905) (@wei840222)
* [ENHANCEMENT] Include additional detail when searching for traces [#916](https:/grafana/tempo/pull/916) (@zalegrala)

## v1.1.0 / 2021-08-26

Expand Down
1 change: 1 addition & 0 deletions modules/querier/querier.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ func (q *Querier) FindTraceByID(ctx context.Context, req *tempopb.TraceByIDReque
traceCountTotal++

span.LogFields(ot_log.String("msg", "combined trace protos from store"),
ot_log.Bool("found", completeTrace != nil),
ot_log.Int("combinedSpans", spanCountTotal),
ot_log.Int("combinedTraces", traceCountTotal))
}
Expand Down
11 changes: 10 additions & 1 deletion tempodb/tempodb.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,15 +291,19 @@ func (rw *readerWriter) Find(ctx context.Context, tenantID string, id common.ID,
blocklist := rw.blocklist.Metas(tenantID)
compactedBlocklist := rw.blocklist.CompactedMetas(tenantID)
copiedBlocklist := make([]interface{}, 0, len(blocklist))
blocksSearched := 0
compactedBlocksSearched := 0

for _, b := range blocklist {
if includeBlock(b, id, blockStartBytes, blockEndBytes) {
copiedBlocklist = append(copiedBlocklist, b)
blocksSearched++
}
}
for _, c := range compactedBlocklist {
if includeCompactedBlock(c, id, blockStartBytes, blockEndBytes, rw.cfg.BlocklistPoll) {
copiedBlocklist = append(copiedBlocklist, &c.BlockMeta)
compactedBlocksSearched++
}
}
if len(copiedBlocklist) == 0 {
Expand All @@ -325,7 +329,12 @@ func (rw *readerWriter) Find(ctx context.Context, tenantID string, id common.ID,
ot_log.String("msg", "searching for trace in block"),
ot_log.String("blockID", meta.BlockID.String()),
ot_log.Bool("found", foundObject != nil),
ot_log.Int("bytes", len(foundObject)))
ot_log.Int("bytes", len(foundObject)),
ot_log.Int("live blocks", len(blocklist)),
ot_log.Int("live blocks searched", blocksSearched),
ot_log.Int("compacted blocks", len(compactedBlocklist)),
ot_log.Int("compacted blocks searched", compactedBlocksSearched),
)

return foundObject, meta.DataEncoding, nil
})
Expand Down