diff --git a/Makefile b/Makefile index 47b081981..82821c6df 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ trace examples: FORCE docker-compose stop collector: docker-compose -f docker-compose-collector.yaml up -d --remove-orphans - docker-compose -f docker-compose-collector.yaml run -e OTEL_EXPORTER_OTLP_ENDPOINT=otel-collector:4317 --rm php php ./examples/AlwaysOnOTLPGrpcExample2.php + docker-compose -f docker-compose-collector.yaml run -e OTEL_EXPORTER_OTLP_ENDPOINT=otel-collector:4318 --rm php php ./examples/AlwaysOnOTLPGrpcExample2.php docker-compose -f docker-compose-collector.yaml stop metrics-prometheus-example: diff --git a/contrib/OtlpGrpc/Exporter.php b/contrib/OtlpGrpc/Exporter.php index 6d3857d71..a4228f1f2 100644 --- a/contrib/OtlpGrpc/Exporter.php +++ b/contrib/OtlpGrpc/Exporter.php @@ -69,7 +69,7 @@ class Exporter implements Trace\Exporter * OTLP GRPC Exporter Constructor */ public function __construct( - string $endpointURL = 'localhost:4317', + string $endpointURL = 'localhost:4318', bool $insecure = true, string $certificateFile = '', string $headers = '', diff --git a/docker-compose-collector.yaml b/docker-compose-collector.yaml index 74ce4266f..a44591e39 100644 --- a/docker-compose-collector.yaml +++ b/docker-compose-collector.yaml @@ -31,6 +31,6 @@ services: - "8889:8889" # Prometheus exporter metrics - "13133:13133" # health_check extension - "9411" # Zipkin receiver - - "4317:4317" # OTLP gRPC receiver + - "4318:4318" # OTLP gRPC receiver - "55681:55681" # Legacy OTLP/HTTP Port - "55680:55679" # zpages extension diff --git a/tests/Contrib/Unit/OTLPGrpcExporterTest.php b/tests/Contrib/Unit/OTLPGrpcExporterTest.php index 905b418d8..bf5919cb4 100644 --- a/tests/Contrib/Unit/OTLPGrpcExporterTest.php +++ b/tests/Contrib/Unit/OTLPGrpcExporterTest.php @@ -43,7 +43,7 @@ public function testExporter() public function testRefusesInvalidHeaders() { - $foo = new Exporter('localhost:4317', true, '', 'a:bc'); + $foo = new Exporter('localhost:4318', true, '', 'a:bc'); $this->assertEquals([], $foo->getHeaders()); @@ -63,7 +63,7 @@ public function testSetHeadersWithEnvironmentVariables() public function testSetHeadersInConstructor() { - $exporter = new Exporter('localhost:4317', true, '', 'x-aaa=foo,x-bbb=bar'); + $exporter = new Exporter('localhost:4318', true, '', 'x-aaa=foo,x-bbb=bar'); $this->assertEquals(['x-aaa' => ['foo'], 'x-bbb' => ['bar']], $exporter->getHeaders()); @@ -126,13 +126,13 @@ private function isInsecure(Exporter $exporter) : bool public function testClientOptions() { // default options - $exporter = new Exporter('localhost:4317'); + $exporter = new Exporter('localhost:4318'); $opts = $exporter->getClientOptions(); $this->assertEquals(10, $opts['timeout']); $this->assertTrue($this->isInsecure($exporter)); $this->assertFalse(array_key_exists('grpc.default_compression_algorithm', $opts)); // method args - $exporter = new Exporter('localhost:4317', false, '', '', true, 5); + $exporter = new Exporter('localhost:4318', false, '', '', true, 5); $opts = $exporter->getClientOptions(); $this->assertEquals(5, $opts['timeout']); $this->assertFalse($this->isInsecure($exporter)); @@ -141,7 +141,7 @@ public function testClientOptions() putenv('OTEL_EXPORTER_OTLP_TIMEOUT=1'); putenv('OTEL_EXPORTER_OTLP_COMPRESSION=1'); putenv('OTEL_EXPORTER_OTLP_INSECURE=false'); - $exporter = new Exporter('localhost:4317'); + $exporter = new Exporter('localhost:4318'); $opts = $exporter->getClientOptions(); $this->assertEquals(1, $opts['timeout']); $this->assertFalse($this->isInsecure($exporter)); diff --git a/tests/Contrib/Unit/OTLPHttpExporterTest.php b/tests/Contrib/Unit/OTLPHttpExporterTest.php index 8cfe8c64f..678bad146 100644 --- a/tests/Contrib/Unit/OTLPHttpExporterTest.php +++ b/tests/Contrib/Unit/OTLPHttpExporterTest.php @@ -187,7 +187,7 @@ public function exporterEndpointDataProvider() { return [ 'Default Endpoint' => ['', 'https://localhost:55681/v1/traces'], - 'Custom Endpoint' => ['https://otel-collector:4317/custom/path', 'https://otel-collector:4317/custom/path'], + 'Custom Endpoint' => ['https://otel-collector:4318/custom/path', 'https://otel-collector:4318/custom/path'], 'Insecure Endpoint' => ['http://api.example.com:80/v1/traces', 'http://api.example.com/v1/traces'], //'Without Path' => ['https://api.example.com', 'https://api.example.com/v1/traces'] # TODO: Support a default path of /v1/traces ];