@@ -82,7 +82,7 @@ func TestPrometheusParser(t *testing.T) {
8282 for _ , scrapeConfig := range cfg .PromConfig .ScrapeConfigs {
8383 assert .Len (t , scrapeConfig .ServiceDiscoveryConfigs , 1 )
8484 assert .Equal (t , scrapeConfig .ServiceDiscoveryConfigs [0 ].Name (), "http" )
85- assert .Equal (t , scrapeConfig .ServiceDiscoveryConfigs [0 ].(* http.SDConfig ).URL , "http ://target-allocator-service:80/jobs/"+ scrapeConfig .JobName + "/targets" )
85+ assert .Equal (t , scrapeConfig .ServiceDiscoveryConfigs [0 ].(* http.SDConfig ).URL , fmt . Sprintf ( "https ://%s- target-allocator-service:80/jobs/", param . OtelCol . Name ) + scrapeConfig .JobName + "/targets" )
8686 expectedMap [scrapeConfig .JobName ] = true
8787 }
8888 for k := range expectedMap {
@@ -106,7 +106,7 @@ func TestPrometheusParser(t *testing.T) {
106106 assert .NotContains (t , prometheusConfig , "scrape_configs" )
107107
108108 expectedTAConfig := map [interface {}]interface {}{
109- "endpoint" : "http ://target-allocator-service:80" ,
109+ "endpoint" : fmt . Sprintf ( "https ://%s- target-allocator-service:80", param . OtelCol . Name ) ,
110110 "interval" : "30s" ,
111111 }
112112 assert .Equal (t , expectedTAConfig , promCfgMap ["target_allocator" ])
@@ -160,7 +160,7 @@ func TestPrometheusParser(t *testing.T) {
160160 assert .NotContains (t , prometheusConfig , "scrape_configs" )
161161
162162 expectedTAConfig := map [interface {}]interface {}{
163- "endpoint" : "http ://target-allocator-service:80" ,
163+ "endpoint" : fmt . Sprintf ( "https ://%s- target-allocator-service:80", param . OtelCol . Name ) ,
164164 "interval" : "30s" ,
165165 }
166166 assert .Equal (t , expectedTAConfig , promCfgMap ["target_allocator" ])
@@ -305,7 +305,7 @@ func TestReplacePrometheusConfig(t *testing.T) {
305305 scrape_configs:
306306 - honor_labels: true
307307 http_sd_configs:
308- - url: http ://target-allocator-service:80/jobs/service-x/targets
308+ - url: https ://test- target-allocator-service:80/jobs/service-x/targets
309309 job_name: service-x
310310 metric_relabel_configs:
311311 - action: keep
@@ -358,7 +358,7 @@ func TestReplacePrometheusConfig(t *testing.T) {
358358 scrape_interval: 1m
359359 scrape_timeout: 10s
360360target_allocator:
361- endpoint: http ://target-allocator-service:80
361+ endpoint: https ://test- target-allocator-service:80
362362 interval: 30s
363363`
364364
0 commit comments