Skip to content

Commit

Permalink
adds traceid to trace too large message (#888)
Browse files Browse the repository at this point in the history
Signed-off-by: Mritunjay Sharma <[email protected]>

adds traceid to trace too large message

Signed-off-by: Mritunjay Sharma <[email protected]>

adds CHANGELOG

Signed-off-by: Mritunjay Sharma <[email protected]>
  • Loading branch information
mritunjaysharma394 authored Aug 18, 2021
1 parent 1c7af6b commit eabe781
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* [BUGFIX] Update port spec for GCS docker-compose example [#869](https://github.com/grafana/tempo/pull/869) (@zalegrala)
* [BUGFIX] Cortex upgrade to fix an issue where unhealthy compactors can't be forgotten [#878](https://github.com/grafana/tempo/pull/878) (@joe-elliott)
* [ENHANCEMENT] Added "query blocks" cli option. [#876](https://github.com/grafana/tempo/pull/876) (@joe-elliott)
* [ENHANCEMENT] Added traceid to `trace too large message`. [#888](https://github.com/grafana/tempo/pull/888) (@mritunjaysharma394)

## v1.1.0-rc.0 / 2021-08-11

Expand Down
3 changes: 2 additions & 1 deletion modules/ingester/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package ingester

import (
"context"
"encoding/hex"
"time"

"github.com/gogo/status"
Expand Down Expand Up @@ -34,7 +35,7 @@ func (t *trace) Push(_ context.Context, trace []byte) error {
if t.maxBytes != 0 {
reqSize := len(trace)
if t.currentBytes+reqSize > t.maxBytes {
return status.Errorf(codes.FailedPrecondition, "%s max size of trace (%d) exceeded while adding %d bytes", overrides.ErrorPrefixTraceTooLarge, t.maxBytes, reqSize)
return status.Errorf(codes.FailedPrecondition, "%s max size of trace (%d) exceeded while adding %d bytes to trace %s", overrides.ErrorPrefixTraceTooLarge, t.maxBytes, reqSize, hex.EncodeToString(t.traceID))
}

t.currentBytes += reqSize
Expand Down

0 comments on commit eabe781

Please sign in to comment.