Skip to content
This repository was archived by the owner on Apr 30, 2025. It is now read-only.

Commit 902f74e

Browse files
Cleanup
Signed-off-by: Michel Hollands <[email protected]>
1 parent 95d2f28 commit 902f74e

File tree

3 files changed

+12
-32
lines changed

3 files changed

+12
-32
lines changed

pkg/ingester/errors.go

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ import (
99
)
1010

1111
type validationError struct {
12-
err error // underlying error
13-
errorType string
14-
code int
15-
noReport bool // if true, error will be counted but not reported to caller
16-
labels labels.Labels
17-
ipAddress string
12+
err error // underlying error
13+
errorType string
14+
code int
15+
noReport bool // if true, error will be counted but not reported to caller
16+
labels labels.Labels
17+
forwardIPAddresses string
1818
}
1919

2020
func makeLimitError(errorType string, err error) error {
@@ -50,8 +50,9 @@ func makeMetricLimitError(errorType string, labels labels.Labels, err error) err
5050
}
5151
}
5252

53-
func (e *validationError) AddIPAddress(ipAddress string) {
54-
e.ipAddress = ipAddress
53+
// AddForwardIPAddresses adds the string containing the addresses to the error
54+
func (e *validationError) AddForwardIPAddresses(ipAddresses string) {
55+
e.forwardIPAddresses = ipAddresses
5556
}
5657

5758
func (e *validationError) Error() string {
@@ -62,8 +63,8 @@ func (e *validationError) Error() string {
6263
return e.err.Error()
6364
}
6465
ipStr := ""
65-
if e.ipAddress != "" {
66-
ipStr = fmt.Sprintf(" from IP address %v", e.ipAddress)
66+
if e.forwardIPAddresses != "" {
67+
ipStr = fmt.Sprintf(" from IP address %v", e.forwardIPAddresses)
6768
}
6869
return fmt.Sprintf("%s%s for series %s", e.err.Error(), ipStr, e.labels.String())
6970
}

pkg/ingester/ingester.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -376,10 +376,6 @@ func (i *Ingester) checkRunningOrStopping() error {
376376

377377
// Push implements client.IngesterServer
378378
func (i *Ingester) Push(ctx context.Context, req *client.WriteRequest) (*client.WriteResponse, error) {
379-
ipAddresses := util.GetSourceFromIncomingCtx(ctx)
380-
// TODO: remove
381-
level.Info(util.Logger).Log("ingestor Push IP addresses received", ipAddresses)
382-
383379
if err := i.checkRunningOrStopping(); err != nil {
384380
return nil, err
385381
}
@@ -507,10 +503,8 @@ func (i *Ingester) append(ctx context.Context, userID string, labels labelPairs,
507503
return nil
508504
}
509505
ipAddresses := util.GetSourceFromIncomingCtx(ctx)
510-
// TODO: remove
511-
level.Info(util.Logger).Log("ingestor IP addresses received", ipAddresses)
512506
if ipAddresses != "" {
513-
ve.AddIPAddress(ipAddresses)
507+
ve.AddForwardIPAddresses(ipAddresses)
514508
}
515509
}
516510
return err

pkg/ingester/ip_address.go

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)