Skip to content

Commit

Permalink
review feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Goutham Veeramachaneni <[email protected]>
  • Loading branch information
gouthamve committed Oct 6, 2022
1 parent 1c374dc commit 50f8b0e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions modules/distributor/receiver/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,13 @@ func (m *multiTenancyMiddleware) Wrap(next consumer.Traces) consumer.Traces {
// Maybe its a HTTP request.
info := client.FromContext(ctx)
orgIDs := info.Metadata.Get(user.OrgIDHeaderName)
if len(orgIDs) != 1 {
log.Logger.Log("msg", "failed to extract org id", "err", err)
if len(orgIDs) == 0 {
log.Logger.Log("msg", "failed to extract org id from both grpc and HTTP", "err", err)
return err
}

if len(orgIDs) > 1 {
log.Logger.Log("msg", "more than one orgID found", "orgIDs", orgIDs)
return err
}

Expand Down

0 comments on commit 50f8b0e

Please sign in to comment.