summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2023-10-20 21:27:10 +0300
committerAndrew Dolgov <[email protected]>2023-10-20 21:27:10 +0300
commit7092a1e85ddfd8e705cbc8ef752c26df944a237a (patch)
tree8be12eaf19f1a1a9da4f4d5e13a59edd632dd2b5
parent62ca093b75329f5d11d67b425ba0efd22649a3c8 (diff)
OPENTELEMETRY_HOST -> OPENTELEMETRY_ENDPOINT
-rw-r--r--classes/config.php4
-rw-r--r--classes/tracer.php6
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();