Skip to content

Commit

Permalink
Fix exemplar for opentel to use traceId instead of spanId and sample …
Browse files Browse the repository at this point in the history
…only if trace is sampled. (#6197)

Signed-off-by: jianwu <jianwu@gmail.com>
  • Loading branch information
jianwu committed Mar 9, 2023
1 parent 3dea8cf commit 8ff2753
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -20,6 +20,7 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re
- [#6172](https://github.com/thanos-io/thanos/pull/6172) query-frontend: return JSON formatted errors for invalid PromQL expression in the split by interval middleware.
- [#6171](https://github.com/thanos-io/thanos/pull/6171) Store: fix error handling on limits.
- [#6183](https://github.com/thanos-io/thanos/pull/6183) Receiver: fix off by one in multitsdb flush that will result in empty blocks if the head only contains one sample
- [#6197](https://github.com/thanos-io/thanos/pull/6197) Exemplar OTel: Fix exemplar for otel to use traceId instead of spanId and sample only if trace is sampled

### Changed
- [#6168](https://github.com/thanos-io/thanos/pull/6168) Receiver: Make ketama hashring fail early when configured with number of nodes lower than the replication factor.
Expand Down
4 changes: 2 additions & 2 deletions pkg/extprom/http/instrument_server.go
Expand Up @@ -97,8 +97,8 @@ func httpInstrumentationHandler(baseLabels prometheus.Labels, metrics *defaultMe
// If OpenTracing span not found, try OTEL.
if !OTfound {
span := trace.SpanFromContext(r.Context())
if span != nil {
traceID = span.SpanContext().SpanID().String()
if span != nil && span.SpanContext().IsSampled() {
traceID = span.SpanContext().TraceID().String()
}
}

Expand Down

0 comments on commit 8ff2753

Please sign in to comment.