open-telemetry / opentelemetry-php

The OpenTelemetry PHP Library
https://opentelemetry.io/docs/instrumentation/php/
Apache License 2.0
751 stars 186 forks source link

Http based exporters require a port and a path in enpoint url #452

Closed tidal closed 2 years ago

tidal commented 3 years ago

Steps to reproduce

Example for Zipikin exporter:

$exporter = new OpenTelemetry\Contrib\Zipkin\Exporter(
    'foo',
    'http://zipkin',
    $client,
    $requestFactory,
    $streamFactory
);

What is the expected behavior?

An exporter instance to be created.

What is the actual behavior?

InvalidArgumentException: Endpoint should have scheme, host, port and path

Additional context

Collector endpoints should be accessible through reverse proxies, load balancers, etc., which may hide the endpoint port and/or path

tidal commented 3 years ago

related: https://github.com/open-telemetry/opentelemetry-php/issues/451 , https://github.com/open-telemetry/opentelemetry-php/issues/448