Skip to content

Commit

Permalink
Merge pull request prometheus#247 from colega/revert-237-user-and-org…
Browse files Browse the repository at this point in the history
…-labels-on-exemplars

Revert "Add user and org labels to observed exemplars"
  • Loading branch information
bboreham authored Jul 19, 2022
2 parents 67d27ed + f620354 commit 75757d3
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions instrument/instrument.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,9 @@ func (c *HistogramCollector) After(ctx context.Context, method, statusCode strin
// (this will always work for a HistogramVec).
func ObserveWithExemplar(ctx context.Context, histogram prometheus.Observer, seconds float64) {
if traceID, ok := tracing.ExtractSampledTraceID(ctx); ok {
lbls := prometheus.Labels{"traceID": traceID}
if userID, err := user.ExtractUserID(ctx); err == nil {
lbls["user"] = userID
}
if orgID, err := user.ExtractOrgID(ctx); err == nil {
lbls["organization"] = orgID
}
histogram.(prometheus.ExemplarObserver).ObserveWithExemplar(
seconds,
lbls,
prometheus.Labels{"traceID": traceID},
)
return
}
Expand Down

0 comments on commit 75757d3

Please sign in to comment.