Update simple-otel.php
This commit is contained in:
parent
c2ad549493
commit
33d0a16f59
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/*
|
||||
Plugin Name: OpenTelemetry Integration
|
||||
Plugin Name: Simple Otel
|
||||
Description: Integrate OpenTelemetry with WordPress.
|
||||
Version: 1.0
|
||||
Author: Colin
|
||||
|
@ -12,6 +12,11 @@ require_once __DIR__ . '/vendor/autoload.php';
|
|||
use OpenTelemetry\SDK\Trace\TracerProviderFactory;
|
||||
use OpenTelemetry\SDK\Common\Util\ShutdownHandler;
|
||||
|
||||
// Include configuration file
|
||||
if (file_exists(__DIR__ . '/config.php')) {
|
||||
include __DIR__ . '/config.php';
|
||||
}
|
||||
|
||||
function otel_init() {
|
||||
$tracerProvider = (new TracerProviderFactory())->create();
|
||||
$GLOBALS['tracer'] = $tracerProvider->getTracer('wordpress');
|
||||
|
|
Loading…
Reference in New Issue