Skip to content

Commit

Permalink
Include additional detail when searching for traces
Browse files Browse the repository at this point in the history
  • Loading branch information
zalegrala committed Aug 26, 2021
1 parent b16e589 commit 3f5bfe4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* [ENHANCEMENT] Add support to tempo workloads to `overrides` from single configmap in microservice mode. [#896](https://github.com/grafana/tempo/pull/896) (@kavirajk)
* [ENHANCEMENT] Make `overrides_config` block name consistent with Loki and Cortex in microservice mode. [#906](https://github.com/grafana/tempo/pull/906) (@kavirajk)
* [ENHANCEMENT] Make `overrides_config` mount name static `tempo-overrides` in the tempo workloads in microservice mode. [#906](https://github.com/grafana/tempo/pull/914) (@kavirajk)
* [ENHANCEMENT] Include additional detail when searching for traces [#916](https://github.com/grafana/tempo/pull/916) (@zalegrala)


## v1.1.0-rc.0 / 2021-08-11
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

0 comments on commit 3f5bfe4

Please sign in to comment.