From 0de1d75b7715a02d85153909f3ad7f927d50953b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=AA=E0=A5=8D=E0=A4=B0=E0=A4=A5=E0=A4=AE=E0=A5=87?= =?UTF-8?q?=E0=A4=B6=20Sonpatki?= Date: Thu, 2 Jan 2025 12:51:48 +0530 Subject: [PATCH] Php 8 example (#45) * Make the app run via docker compose * Add basic DB monitoring * Refactoring * Allow tracking parent span id * Update the example to use mysqli * Update README * WIP * wip * Working setup * Working copy * Working copy * Add README and extract common logic * Remove conflicts --- php/core/8/index.php | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/php/core/8/index.php b/php/core/8/index.php index d12693b..e8f08cc 100644 --- a/php/core/8/index.php +++ b/php/core/8/index.php @@ -109,16 +109,12 @@ } catch (\Exception $e) { throw $e; } -<<<<<<< HEAD $instrumentation->setSuccess(); -======= ->>>>>>> 339c63609672e1ebd4d1dccfaaaa6ee0ff684d33 break; default: http_response_code(404); echo "404 Not Found"; -<<<<<<< HEAD $instrumentation->setError(new Exception("404 Not Found")); break; } @@ -129,24 +125,3 @@ http_response_code(500); echo "Error: " . $e->getMessage(); } -======= - break; - } - $rootSpan->setStatus(StatusCode::STATUS_OK); - -} catch (Exception $e) { - $rootSpan->setStatus(StatusCode::STATUS_ERROR, $e->getMessage()); - error_log("Main error: " . $e->getMessage()); - http_response_code(500); - echo "Error: " . $e->getMessage(); -} finally { - // End the root scope and span last - $scope->detach(); - $rootSpan->end(); -} - -// Register shutdown function to handle final export -register_shutdown_function(function() use ($tracerProvider) { - $tracerProvider->shutdown(); -}); ->>>>>>> 339c63609672e1ebd4d1dccfaaaa6ee0ff684d33