OPENTELEMETRY_HOST -> OPENTELEMETRY_ENDPOINT
This commit is contained in:
parent
62ca093b75
commit
7092a1e85d
|
@ -193,7 +193,7 @@ class Config {
|
||||||
const HTTP_429_THROTTLE_INTERVAL = "HTTP_429_THROTTLE_INTERVAL";
|
const HTTP_429_THROTTLE_INTERVAL = "HTTP_429_THROTTLE_INTERVAL";
|
||||||
|
|
||||||
/** host running Jaeger collector to receive traces (disabled if empty) */
|
/** host running Jaeger collector to receive traces (disabled if empty) */
|
||||||
const OPENTELEMETRY_HOST = "OPENTELEMETRY_HOST";
|
const OPENTELEMETRY_ENDPOINT = "OPENTELEMETRY_ENDPOINT";
|
||||||
|
|
||||||
/** Jaeger service name */
|
/** Jaeger service name */
|
||||||
const OPENTELEMETRY_SERVICE = "OPENTELEMETRY_SERVICE";
|
const OPENTELEMETRY_SERVICE = "OPENTELEMETRY_SERVICE";
|
||||||
|
@ -255,7 +255,7 @@ class Config {
|
||||||
Config::HTTP_USER_AGENT => [ 'Tiny Tiny RSS/%s (https://tt-rss.org/)',
|
Config::HTTP_USER_AGENT => [ 'Tiny Tiny RSS/%s (https://tt-rss.org/)',
|
||||||
Config::T_STRING ],
|
Config::T_STRING ],
|
||||||
Config::HTTP_429_THROTTLE_INTERVAL => [ 3600, Config::T_INT ],
|
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 ],
|
Config::OPENTELEMETRY_SERVICE => [ "tt-rss", Config::T_STRING ],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -16,10 +16,10 @@ class Tracer {
|
||||||
private static $tracer;
|
private static $tracer;
|
||||||
|
|
||||||
public function __construct() {
|
public function __construct() {
|
||||||
$opentelemetry_host = Config::get(Config::OPENTELEMETRY_HOST);
|
$OPENTELEMETRY_ENDPOINT = Config::get(Config::OPENTELEMETRY_ENDPOINT);
|
||||||
|
|
||||||
if ($opentelemetry_host) {
|
if ($OPENTELEMETRY_ENDPOINT) {
|
||||||
$transport = (new OtlpHttpTransportFactory())->create("http://$opentelemetry_host/v1/traces", 'application/x-protobuf');
|
$transport = (new OtlpHttpTransportFactory())->create($OPENTELEMETRY_ENDPOINT, 'application/x-protobuf');
|
||||||
$exporter = new SpanExporter($transport);
|
$exporter = new SpanExporter($transport);
|
||||||
} else {
|
} else {
|
||||||
$exporter = new InMemoryExporter();
|
$exporter = new InMemoryExporter();
|
||||||
|
|
Loading…
Reference in New Issue