diff --git a/classes/config.php b/classes/config.php index 302a5763e..50ad8c10f 100644 --- a/classes/config.php +++ b/classes/config.php @@ -193,7 +193,7 @@ class Config { const HTTP_429_THROTTLE_INTERVAL = "HTTP_429_THROTTLE_INTERVAL"; /** host running Jaeger collector to receive traces (disabled if empty) */ - const OPENTELEMETRY_HOST = "OPENTELEMETRY_HOST"; + const OPENTELEMETRY_ENDPOINT = "OPENTELEMETRY_ENDPOINT"; /** Jaeger service name */ const OPENTELEMETRY_SERVICE = "OPENTELEMETRY_SERVICE"; @@ -255,7 +255,7 @@ class Config { Config::HTTP_USER_AGENT => [ 'Tiny Tiny RSS/%s (https://tt-rss.org/)', Config::T_STRING ], Config::HTTP_429_THROTTLE_INTERVAL => [ 3600, Config::T_INT ], - Config::OPENTELEMETRY_HOST => [ "", Config::T_STRING ], + Config::OPENTELEMETRY_ENDPOINT => [ "", Config::T_STRING ], Config::OPENTELEMETRY_SERVICE => [ "tt-rss", Config::T_STRING ], ]; diff --git a/classes/tracer.php b/classes/tracer.php index d788cfdba..4fee8769a 100644 --- a/classes/tracer.php +++ b/classes/tracer.php @@ -16,10 +16,10 @@ class Tracer { private static $tracer; public function __construct() { - $opentelemetry_host = Config::get(Config::OPENTELEMETRY_HOST); + $OPENTELEMETRY_ENDPOINT = Config::get(Config::OPENTELEMETRY_ENDPOINT); - if ($opentelemetry_host) { - $transport = (new OtlpHttpTransportFactory())->create("http://$opentelemetry_host/v1/traces", 'application/x-protobuf'); + if ($OPENTELEMETRY_ENDPOINT) { + $transport = (new OtlpHttpTransportFactory())->create($OPENTELEMETRY_ENDPOINT, 'application/x-protobuf'); $exporter = new SpanExporter($transport); } else { $exporter = new InMemoryExporter();