Skip to content

Commit

Permalink
test: use more stable ip in otlp grpc logs ip system test (#12037)
Browse files Browse the repository at this point in the history
  • Loading branch information
kruskall authored Nov 13, 2023
1 parent a88fd41 commit bd2a453
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
13 changes: 5 additions & 8 deletions systemtest/approvals/TestOTLPGRPCLogsClientIP.approved.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,15 @@
},
"client": {
"geo": {
"city_name": "dynamic",
"continent_name": "Europe",
"country_iso_code": "ES",
"country_name": "Spain",
"country_iso_code": "DE",
"country_name": "Germany",
"location": {
"lat": "dynamic",
"lon": "dynamic"
},
"region_iso_code": "dynamic",
"region_name": "dynamic"
}
},
"ip": "195.55.79.118"
"ip": "178.162.206.244"
},
"data_stream": {
"dataset": "apm.app.unknown",
Expand Down Expand Up @@ -51,7 +48,7 @@
"name": "unknown"
},
"source": {
"ip": "195.55.79.118",
"ip": "178.162.206.244",
"nat": {
"ip": "127.0.0.1"
}
Expand Down
4 changes: 2 additions & 2 deletions systemtest/otlp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ func TestOTLPGRPCLogsClientIP(t *testing.T) {
defer cancel()

// Override local IP address to be found in "GeoLite2-City.mmdb".
md := metadata.New(map[string]string{"X-Forwarded-For": "195.55.79.118"})
md := metadata.New(map[string]string{"X-Forwarded-For": "178.162.206.244"})
ctx = metadata.NewOutgoingContext(ctx, md)

conn, err := grpc.Dial(serverAddr(srv), grpc.WithInsecure(), grpc.WithBlock(), grpc.WithDefaultCallOptions(grpc.UseCompressor("gzip")))
Expand All @@ -478,7 +478,7 @@ func TestOTLPGRPCLogsClientIP(t *testing.T) {
require.NoError(t, err)

result := estest.ExpectDocs(t, systemtest.Elasticsearch, "logs-apm*", nil)
approvaltest.ApproveEvents(t, t.Name(), result.Hits.Hits, "client.geo.city_name", "client.geo.location.lat", "client.geo.location.lon", "client.geo.region_iso_code", "client.geo.region_name")
approvaltest.ApproveEvents(t, t.Name(), result.Hits.Hits, "client.geo.location.lat", "client.geo.location.lon")
}

func newMobileLogs(body interface{}) plog.Logs {
Expand Down

0 comments on commit bd2a453

Please sign in to comment.