@@ -297,6 +297,8 @@ func (d *Distributor) PushParsed(ctx context.Context, req *distributormodel.Push
297
297
return nil , connect .NewError (connect .CodeUnauthenticated , err )
298
298
}
299
299
300
+ logger := log .With (d .logger , "tenant" , tenantID )
301
+
300
302
req .TenantID = tenantID
301
303
for _ , series := range req .Series {
302
304
serviceName := phlaremodel .Labels (series .Labels ).Get (phlaremodel .LabelNameServiceName )
@@ -323,7 +325,7 @@ func (d *Distributor) PushParsed(ctx context.Context, req *distributormodel.Push
323
325
// They are unfortunately part of the Push API so we explicitly clear them here.
324
326
req .ClearAnnotations ()
325
327
if err := d .checkIngestLimit (req ); err != nil {
326
- level .Debug (d . logger ).Log ("msg" , "rejecting push request due to global ingest limit" , "tenant" , tenantID )
328
+ level .Debug (logger ).Log ("msg" , "rejecting push request due to global ingest limit" , "tenant" , tenantID )
327
329
validation .DiscardedProfiles .WithLabelValues (string (validation .IngestLimitReached ), tenantID ).Add (float64 (req .TotalProfiles ))
328
330
validation .DiscardedBytes .WithLabelValues (string (validation .IngestLimitReached ), tenantID ).Add (float64 (req .TotalBytesUncompressed ))
329
331
return nil , err
@@ -340,15 +342,15 @@ func (d *Distributor) PushParsed(ctx context.Context, req *distributormodel.Push
340
342
341
343
groups := d .usageGroupEvaluator .GetMatch (tenantID , usageGroups , series .Labels )
342
344
if err := d .checkUsageGroupsIngestLimit (req , groups .Names ()); err != nil {
343
- level .Debug (d . logger ).Log ("msg" , "rejecting push request due to usage group ingest limit" , "tenant" , tenantID )
345
+ level .Debug (logger ).Log ("msg" , "rejecting push request due to usage group ingest limit" , "tenant" , tenantID )
344
346
validation .DiscardedProfiles .WithLabelValues (string (validation .IngestLimitReached ), tenantID ).Add (float64 (req .TotalProfiles ))
345
347
validation .DiscardedBytes .WithLabelValues (string (validation .IngestLimitReached ), tenantID ).Add (float64 (req .TotalBytesUncompressed ))
346
348
groups .CountDiscardedBytes (string (validation .IngestLimitReached ), req .TotalBytesUncompressed )
347
349
return nil , err
348
350
}
349
351
350
352
if sample := d .shouldSample (tenantID , groups .Names ()); ! sample {
351
- level .Debug (d . logger ).Log ("msg" , "skipping push request due to sampling" , "tenant" , tenantID )
353
+ level .Debug (logger ).Log ("msg" , "skipping push request due to sampling" , "tenant" , tenantID )
352
354
validation .DiscardedProfiles .WithLabelValues (string (validation .SkippedBySamplingRules ), tenantID ).Add (float64 (req .TotalProfiles ))
353
355
validation .DiscardedBytes .WithLabelValues (string (validation .SkippedBySamplingRules ), tenantID ).Add (float64 (req .TotalBytesUncompressed ))
354
356
groups .CountDiscardedBytes (string (validation .SkippedBySamplingRules ), req .TotalBytesUncompressed )
@@ -371,7 +373,7 @@ func (d *Distributor) PushParsed(ctx context.Context, req *distributormodel.Push
371
373
groups .CountReceivedBytes (profName , int64 (decompressedSize ))
372
374
373
375
if err = validation .ValidateProfile (d .limits , tenantID , p .Profile , decompressedSize , series .Labels , now ); err != nil {
374
- _ = level .Debug (d . logger ).Log ("msg" , "invalid profile" , "err" , err )
376
+ _ = level .Debug (logger ).Log ("msg" , "invalid profile" , "err" , err )
375
377
reason := string (validation .ReasonOf (err ))
376
378
validation .DiscardedProfiles .WithLabelValues (reason , tenantID ).Add (float64 (req .TotalProfiles ))
377
379
validation .DiscardedBytes .WithLabelValues (reason , tenantID ).Add (float64 (req .TotalBytesUncompressed ))
@@ -410,7 +412,7 @@ func (d *Distributor) PushParsed(ctx context.Context, req *distributormodel.Push
410
412
}
411
413
412
414
if err := injectMappingVersions (req .Series ); err != nil {
413
- _ = level .Warn (d . logger ).Log ("msg" , "failed to inject mapping versions" , "err" , err )
415
+ _ = level .Warn (logger ).Log ("msg" , "failed to inject mapping versions" , "err" , err )
414
416
}
415
417
416
418
// Reduce cardinality of the session_id label.
0 commit comments