1
0
Fork 1

Update simple-otel.php

This commit is contained in:
colin 2024-07-01 18:08:23 +00:00
parent c2ad549493
commit 33d0a16f59
1 changed files with 6 additions and 1 deletions

View File

@ -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');