Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update OTLP/HTTP Default Port Per Changes to the Spec #438

Merged
merged 5 commits into from Oct 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion docker-compose-collector.yaml
Expand Up @@ -32,5 +32,5 @@ services:
- "13133:13133" # health_check extension
- "9411" # Zipkin receiver
- "4317:4317" # OTLP gRPC receiver
- "55681:55681" # Legacy OTLP/HTTP Port
- "4318:4318" # OTLP/HTTP receiver
- "55680:55679" # zpages extension
2 changes: 1 addition & 1 deletion src/Contrib/OtlpHttp/Exporter.php
Expand Up @@ -88,7 +88,7 @@ public function __construct(
) {

// Set default values based on presence of env variable
$this->endpointUrl = getenv('OTEL_EXPORTER_OTLP_ENDPOINT') ?: 'https://localhost:55681/v1/traces';
$this->endpointUrl = getenv('OTEL_EXPORTER_OTLP_ENDPOINT') ?: 'https://localhost:4318/v1/traces';
$this->protocol = getenv('OTEL_EXPORTER_OTLP_PROTOCOL') ?: 'http/protobuf';
$this->certificateFile = getenv('OTEL_EXPORTER_OTLP_CERTIFICATE') ?: 'none';
$this->headers = $this->processHeaders(getenv('OTEL_EXPORTER_OTLP_HEADERS'));
Expand Down
4 changes: 2 additions & 2 deletions tests/Contrib/Unit/OTLPHttpExporterTest.php
Expand Up @@ -178,8 +178,8 @@ public function testExporterWithConfigViaEnvVars($endpoint, $expectedEndpoint)
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'],
'Default Endpoint' => ['', 'https://localhost:4318/v1/traces'],
'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
];
Expand Down