@@ -12,6 +12,7 @@ import (
12
12
"fmt"
13
13
"io"
14
14
"net/http"
15
+ "strconv"
15
16
"strings"
16
17
"sync"
17
18
"testing"
@@ -97,7 +98,9 @@ func testIntegration(t *testing.T) {
97
98
server := testutil .DatadogServerMock (apmstatsRec .HandlerFunc , tracesRec .HandlerFunc )
98
99
defer server .Close ()
99
100
t .Setenv ("SERVER_URL" , server .URL )
100
- t .Setenv ("PROM_SERVER" , commonTestutil .GetAvailableLocalAddress (t ))
101
+ promPort := strconv .Itoa (commonTestutil .GetAvailablePort (t ))
102
+ t .Setenv ("PROM_SERVER_PORT" , promPort )
103
+ t .Setenv ("PROM_SERVER" , fmt .Sprintf ("localhost:%s" , promPort ))
101
104
t .Setenv ("OTLP_HTTP_SERVER" , commonTestutil .GetAvailableLocalAddress (t ))
102
105
otlpGRPCEndpoint := commonTestutil .GetAvailableLocalAddress (t )
103
106
t .Setenv ("OTLP_GRPC_SERVER" , otlpGRPCEndpoint )
@@ -292,7 +295,9 @@ func TestIntegrationComputeTopLevelBySpanKind(t *testing.T) {
292
295
server := testutil .DatadogServerMock (apmstatsRec .HandlerFunc , tracesRec .HandlerFunc )
293
296
defer server .Close ()
294
297
t .Setenv ("SERVER_URL" , server .URL )
295
- t .Setenv ("PROM_SERVER" , commonTestutil .GetAvailableLocalAddress (t ))
298
+ promPort := strconv .Itoa (commonTestutil .GetAvailablePort (t ))
299
+ t .Setenv ("PROM_SERVER_PORT" , promPort )
300
+ t .Setenv ("PROM_SERVER" , fmt .Sprintf ("localhost:%s" , promPort ))
296
301
t .Setenv ("OTLP_HTTP_SERVER" , commonTestutil .GetAvailableLocalAddress (t ))
297
302
otlpGRPCEndpoint := commonTestutil .GetAvailableLocalAddress (t )
298
303
t .Setenv ("OTLP_GRPC_SERVER" , otlpGRPCEndpoint )
@@ -452,7 +457,6 @@ func sendTracesComputeTopLevelBySpanKind(t *testing.T, endpoint string) {
452
457
}
453
458
454
459
func TestIntegrationLogs (t * testing.T ) {
455
- t .Skip ("skipping test, see https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/39064" )
456
460
// 1. Set up mock Datadog server
457
461
// See also https://github.com/DataDog/datadog-agent/blob/49c16e0d4deab396626238fa1d572b684475a53f/cmd/trace-agent/test/backend.go
458
462
seriesRec := & testutil.HTTPRequestRecorderWithChan {Pattern : testutil .MetricV2Endpoint , ReqChan : make (chan []byte )}
@@ -476,9 +480,10 @@ func TestIntegrationLogs(t *testing.T) {
476
480
}
477
481
})
478
482
defer server .Close ()
479
- thing := commonTestutil .GetAvailableLocalAddress (t )
480
483
t .Setenv ("SERVER_URL" , server .URL )
481
- t .Setenv ("PROM_SERVER" , thing )
484
+ promPort := strconv .Itoa (commonTestutil .GetAvailablePort (t ))
485
+ t .Setenv ("PROM_SERVER_PORT" , promPort )
486
+ t .Setenv ("PROM_SERVER" , fmt .Sprintf ("localhost:%s" , promPort ))
482
487
t .Setenv ("OTLP_HTTP_SERVER" , commonTestutil .GetAvailableLocalAddress (t ))
483
488
otlpGRPCEndpoint := commonTestutil .GetAvailableLocalAddress (t )
484
489
t .Setenv ("OTLP_GRPC_SERVER" , otlpGRPCEndpoint )
0 commit comments