From 7092a1e85ddfd8e705cbc8ef752c26df944a237a Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 20 Oct 2023 21:27:10 +0300 Subject: [PATCH] OPENTELEMETRY_HOST -> OPENTELEMETRY_ENDPOINT --- classes/config.php | 4 ++-- classes/tracer.php | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) 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();