Sets elasticsearch downloader for in-cluster running.

This commit is contained in:
benbierens 2023-10-03 14:32:31 +02:00
parent 1bca2bb928
commit adbd481c7c
No known key found for this signature in database
GPG Key ID: FE44815D96D0A1AA
1 changed files with 9 additions and 7 deletions

View File

@ -58,7 +58,9 @@ namespace ContinuousTests
private IHttp CreateElasticSearchHttp() private IHttp CreateElasticSearchHttp()
{ {
var address = new Address("http://localhost", 9200); var serviceName = "elasticsearch";
var k8sNamespace = "monitoring";
var address = new Address($"http://{serviceName}.{k8sNamespace}.svc.cluster.local", 9200);
var baseUrl = ""; var baseUrl = "";
return tools.CreateHttp(address, baseUrl, client => return tools.CreateHttp(address, baseUrl, client =>
{ {
@ -201,24 +203,24 @@ namespace ContinuousTests
public class SearchResponse public class SearchResponse
{ {
public SearchHits hits { get; set; } public SearchHits hits { get; set; } = new SearchHits();
} }
public class SearchHits public class SearchHits
{ {
public SearchHitEntry[] hits { get; set; } public SearchHitEntry[] hits { get; set; } = Array.Empty<SearchHitEntry>();
} }
public class SearchHitEntry public class SearchHitEntry
{ {
public SearchHitFields fields { get; set; } public SearchHitFields fields { get; set; } = new SearchHitFields();
public long[] sort { get; set; } public long[] sort { get; set; } = Array.Empty<long>();
} }
public class SearchHitFields public class SearchHitFields
{ {
public string[] @timestamp { get; set; } public string[] @timestamp { get; set; } = Array.Empty<string>();
public string[] message { get; set; } public string[] message { get; set; } = Array.Empty<string>();
} }
} }
} }