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