Comments (5)
Hi @TheLevti 👋
Thanks for opening this feature request!
On my sandbox, I've tried the following:
1. Sending a sample exception
try {
// ...
} catch (\Exception $e) {
Log::error('An error occurred', [
'error.message' => $e->getMessage(),
'error.kind' => get_class($e),
'error.stack' => $e->getTraceAsString(),
]);
}
Nota Bene: Monolog with JSON formatting
2. Adding the necessary remapping pipelines
The above currently adds the error information under the context
array; hence, the pipeline would need to be enhanced with three remappers, remapping each of these context.error.X
to error.X
Result
With the two above steps being done, I can get my errors in error tracking, as shown by the screenshots below:
To ensure that Error Tracking can capture errors in your PHP code, we can add three remappers to the default PHP pipeline. However, while we work on implementing this, you may add these remappers to your pipeline on your end as well. This will prevent you from waiting for us to add them to our backend.
Please let me know if this aligns with your requirements or if I have misunderstood your request.
Thank you for your collaboration!
from dd-trace-php.
Great! I was attempting something similar, instead I added a datadog processor that would populate those fields in the extras
array to not pollute the given context from the application (if context.exception
is provided of course).
What I did not do is adding remapping settings, but instead added my own custom JsonFormatter that would move the error array out of extras into the root. So it should have also worked, or?
I will try to do how you did it.
Would be nice if the default php remappers can check both, the extras and context array. Thank you for the hints, will let you know if it worked.
from dd-trace-php.
Related Issues (20)
- [Documentation]: OTEL tracing HOT 8
- [Feature] Add JSON body items to http.request
- [Feature] Laravel Livewire 3 Support
- [Bug]: Standalone null Return Type for update_span_duration Causes Phan Parsing to Fail for PHP <8.2 HOT 1
- [Bug]: new operation `command_execution` HOT 3
- [Bug]: Memory leak in creating Tracer HOT 8
- [Bug]: 0.98.x tar.gz file size increased? HOT 4
- [Bug]: Bad signature error HOT 6
- [Bug]: CLI PHP Processes do not stop and with Apache (mod_php) the connection is closed unexpectedly HOT 1
- [Bug]: Laravel Octane traces not showing in dashboard HOT 16
- [Bug]: Service name is always "laravelqueue" and can't be changed HOT 2
- [Feature] Missing instrumentation for batched AMQP publishing
- [Bug]: Integrations being added as Services in the APM UI HOT 1
- [Help]: Configurations in Docker and kubernetes HOT 9
- [Bug]: DD Trace breaks project with PHP 8.3.7 - Laravel 11.7 HOT 4
- [Bug]: Memory leak with DD_APPSEC_ENABLED="false" HOT 3
- Standalone install from IPv6-only server HOT 4
- [Bug]: post-install.sh does not detect the 'json' extension on PHP 8.1.29 HOT 2
- [Bug]: Failed connecting to the sidecar
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dd-trace-php.