From c2ad549493fc405260543e064454cae7dbe88fb8 Mon Sep 17 00:00:00 2001 From: colin Date: Mon, 1 Jul 2024 18:06:28 +0000 Subject: [PATCH] Update simple-otel.php --- simple-otel.php | 33 +++++++++++++++++++++++++++++++++ simple-status.php | 16 ---------------- 2 files changed, 33 insertions(+), 16 deletions(-) create mode 100644 simple-otel.php delete mode 100644 simple-status.php diff --git a/simple-otel.php b/simple-otel.php new file mode 100644 index 0000000..43667c5 --- /dev/null +++ b/simple-otel.php @@ -0,0 +1,33 @@ +create(); + $GLOBALS['tracer'] = $tracerProvider->getTracer('wordpress'); + + $shutdownHandler = new ShutdownHandler($tracerProvider); + register_shutdown_function([$shutdownHandler, 'shutdown']); +} +add_action('init', 'otel_init'); + +function otel_trace_example() { + $tracer = $GLOBALS['tracer']; + $span = $tracer->startAndActivateSpan('example-span'); + + // Your custom code + + $tracer->endActiveSpan(); +} +add_action('wp_head', 'otel_trace_example'); +?> diff --git a/simple-status.php b/simple-status.php deleted file mode 100644 index a92c3e7..0000000 --- a/simple-status.php +++ /dev/null @@ -1,16 +0,0 @@ -