Skip to content
This repository has been archived by the owner on Feb 28, 2024. It is now read-only.

Commit

Permalink
fix nil pointer error on trace by id path (grafana#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 and tanner-bruce committed Aug 9, 2022
1 parent d3880a9 commit 850a1e9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
## main / unreleased
[##](##) main / unreleased

* [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

* [BUGFIX] metrics-generator: don't inject X-Scope-OrgID header for single-tenant setups [1417](https://github.com/grafana/tempo/pull/1417) (@kvrhdn)
* [BUGFIX] compactor: populate `compaction_objects_combined_total` and `tempo_discarded_spans_total{reason="trace_too_large_to_compact"}` metrics again [1420](https://github.com/grafana/tempo/pull/1420) (@mdisibio)
Expand Down
6 changes: 4 additions & 2 deletions modules/frontend/frontend.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,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 850a1e9

Please sign in to comment.