Skip to content

Commit

Permalink
Revert "change OTLP/HTTP port (open-telemetry#389) (open-telemetry#398)"
Browse files Browse the repository at this point in the history
This reverts commit 8e64874.
  • Loading branch information
SeanHood committed Aug 17, 2021
1 parent 98fcced commit 0a1bc1f
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:4318 --rm php php ./examples/AlwaysOnOTLPGrpcExample2.php
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 stop

metrics-prometheus-example:
Expand Down
2 changes: 1 addition & 1 deletion contrib/OtlpGrpc/Exporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class Exporter implements Trace\Exporter
* OTLP GRPC Exporter Constructor
*/
public function __construct(
string $endpointURL = 'localhost:4318',
string $endpointURL = 'localhost:4317',
bool $insecure = true,
string $certificateFile = '',
string $headers = '',
Expand Down
2 changes: 1 addition & 1 deletion docker-compose-collector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ services:
- "8889:8889" # Prometheus exporter metrics
- "13133:13133" # health_check extension
- "9411" # Zipkin receiver
- "4318:4318" # OTLP gRPC receiver
- "4317:4317" # OTLP gRPC receiver
- "55681:55681" # Legacy OTLP/HTTP Port
- "55680:55679" # zpages extension
10 changes: 5 additions & 5 deletions tests/Contrib/Unit/OTLPGrpcExporterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function testExporter()

public function testRefusesInvalidHeaders()
{
$foo = new Exporter('localhost:4318', true, '', 'a:bc');
$foo = new Exporter('localhost:4317', true, '', 'a:bc');

$this->assertEquals([], $foo->getHeaders());

Expand All @@ -63,7 +63,7 @@ public function testSetHeadersWithEnvironmentVariables()

public function testSetHeadersInConstructor()
{
$exporter = new Exporter('localhost:4318', true, '', 'x-aaa=foo,x-bbb=bar');
$exporter = new Exporter('localhost:4317', true, '', 'x-aaa=foo,x-bbb=bar');

$this->assertEquals(['x-aaa' => ['foo'], 'x-bbb' => ['bar']], $exporter->getHeaders());

Expand Down Expand Up @@ -126,13 +126,13 @@ private function isInsecure(Exporter $exporter) : bool
public function testClientOptions()
{
// default options
$exporter = new Exporter('localhost:4318');
$exporter = new Exporter('localhost:4317');
$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:4318', false, '', '', true, 5);
$exporter = new Exporter('localhost:4317', false, '', '', true, 5);
$opts = $exporter->getClientOptions();
$this->assertEquals(5, $opts['timeout']);
$this->assertFalse($this->isInsecure($exporter));
Expand All @@ -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:4318');
$exporter = new Exporter('localhost:4317');
$opts = $exporter->getClientOptions();
$this->assertEquals(1, $opts['timeout']);
$this->assertFalse($this->isInsecure($exporter));
Expand Down
2 changes: 1 addition & 1 deletion tests/Contrib/Unit/OTLPHttpExporterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public function exporterEndpointDataProvider()
{
return [
'Default Endpoint' => ['', 'https://localhost:55681/v1/traces'],
'Custom Endpoint' => ['https://otel-collector:4318/custom/path', 'https://otel-collector:4318/custom/path'],
'Custom Endpoint' => ['https://otel-collector:4317/custom/path', 'https://otel-collector:4317/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
];
Expand Down

0 comments on commit 0a1bc1f

Please sign in to comment.