Skip to content

Commit

Permalink
Php 8 example (#45)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
prathamesh-sonpatki authored Jan 2, 2025
1 parent 4bae3af commit 0de1d75
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions php/core/8/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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

0 comments on commit 0de1d75

Please sign in to comment.