Skip to content

Commit

Permalink
fix nil pointer error on trace by id path (#1441)
Browse files Browse the repository at this point in the history
* fix nil pointer error on trace by id path

Signed-off-by: Joe Elliott <number101010@gmail.com>

* changelog

Signed-off-by: Joe Elliott <number101010@gmail.com>
  • Loading branch information
joe-elliott authored May 24, 2022
1 parent 8cd7dc7 commit d46f67a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* [CHANGE] metrics-generator: Changed added metric label `instance` to `__metrics_gen_instance` to reduce collisions with custom dimensions. [#1439](https://github.com/grafana/tempo/pull/1439) (@joe-elliott)
* [FEATURE] metrics-generator: support per-tenant processor configuration [#1434](https://github.com/grafana/tempo/pull/1434) (@kvrhdn)
* [ENHANCEMENT] Added the ability to have a per tenant max search duration. [#1421](https://github.com/grafana/tempo/pull/1421) (@joe-elliott)
* [BUGFIX] Fix nil pointer panic when the trace by id path errors. [1441](https://github.com/grafana/tempo/pull/1441) (@joe-elliott)

## v1.4.1 / 2022-05-05

Expand Down
6 changes: 4 additions & 2 deletions modules/frontend/frontend.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,16 @@ func newTraceByIDMiddleware(cfg Config, logger log.Logger) Middleware {
}
resp.Body = io.NopCloser(bytes.NewReader(traceBuffer))
}

if resp.Header != nil {
resp.Header.Set(api.HeaderContentType, marshallingFormat)
}
}
span := opentracing.SpanFromContext(r.Context())
if span != nil {
span.SetTag("contentType", marshallingFormat)
}

resp.Header.Set(api.HeaderContentType, marshallingFormat)

return resp, err
})
})
Expand Down

0 comments on commit d46f67a

Please sign in to comment.