From 817b59bbedc68925debabad6930131be84dee697 Mon Sep 17 00:00:00 2001 From: Mritunjay Sharma Date: Wed, 18 Aug 2021 18:43:02 +0530 Subject: [PATCH] adds traceid to trace too large message Signed-off-by: Mritunjay Sharma adds traceid to trace too large message Signed-off-by: Mritunjay Sharma adds CHANGELOG Signed-off-by: Mritunjay Sharma --- CHANGELOG.md | 1 + modules/ingester/trace.go | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7032b857a2f..66f75cc62f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/modules/ingester/trace.go b/modules/ingester/trace.go index aee4297b0a3..5c98201a0cc 100644 --- a/modules/ingester/trace.go +++ b/modules/ingester/trace.go @@ -2,6 +2,7 @@ package ingester import ( "context" + "encoding/hex" "time" "github.com/gogo/status" @@ -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