Comments (5)
microtime(true) returns microseconds, so the initProifler
is called ~0,03ms after SENTRY_AUTOLOAD
was set.
from sentry-php.
We already confirmed that it's an issue on the Sentry FE. I will link to the PR later.
from sentry-php.
@stayallive So we did debug this, and I think there is some issue with calculating the span durations in the Laravel SDK.
Given the following profile (internal link)
I got the following timestamps:
REQUEST_TIME_FLOAT
1690235634.2881
LARAVEL_START
1690235634.2891
SENTRY_AUTOLOAD
1690235634.296
Time startTransaction
1690235634.2881
Time initProfiler
1690235634.3329
Profile Start Time Stamp
1690235634.3329
And the following samples:
"samples":[
{
"elapsed_since_start_ns":7133916,
"stack_id":0,
"thread_id":"0"
},
{
"elapsed_since_start_ns":17597166,
"stack_id":1,
"thread_id":"0"
},
{
"elapsed_since_start_ns":29798958,
"stack_id":2,
"thread_id":"0"
}
Doing the math, the profile starts ~7ms after the transaction starts. So I would assume that the `app.bootstrap span is too long.
from sentry-php.
This one is interesting, it's a 75ms request in total (according to our transaction), But there are only 3 samples, which I would expect to be a little more, but that could be due to the way Excimer works.
Reading the code, the profile should start after app.bootstrap
, I say this because:
- We start the transaction, which starts the profile: https://github.com/getsentry/sentry-laravel/blob/a97d5eb2ecc86523dbcca729a75bb70b3f0570fe/src/Sentry/Laravel/Tracing/Middleware.php#L164
- After that we jump into the code creating the
app.bootstrap
spans: https://github.com/getsentry/sentry-laravel/blob/a97d5eb2ecc86523dbcca729a75bb70b3f0570fe/src/Sentry/Laravel/Tracing/Middleware.php#L176 - BUT we already have an end time for it by the time we end up there: https://github.com/getsentry/sentry-laravel/blob/a97d5eb2ecc86523dbcca729a75bb70b3f0570fe/src/Sentry/Laravel/Tracing/Middleware.php#L202
- This is because: https://github.com/getsentry/sentry-laravel/blob/a97d5eb2ecc86523dbcca729a75bb70b3f0570fe/src/Sentry/Laravel/Tracing/ServiceProvider.php#L37-L39
So the booted event has already taken place and we are merely backdating the app.bootstrap
since there was no transaction (or profile) active while the application was bootstrapping (which is a problem to solve another time).
The profile frames are also all descendants of Kernel::handle
which runs after the app bootstraps and is the main entrypoint for handling the HTTP request.
But having said all that, I don't see where or why there is only 4ms between the autoload and initProfiler
call since I would expect (based on the transasction data) that te quite some later with more like 30ms in between.
SENTRY_AUTOLOAD
1690235634.296
Time initProfiler
1690235634.3329
Anyway, maybe this ramble helps you point out a flaw in my thinking or the code!
from sentry-php.
Fixed in getsentry/sentry#53655
from sentry-php.
Related Issues (20)
- SpotlightJS - override URL/port for sidecar
- Profiling/Performance not recorded HOT 4
- PHP7 compatibility HOT 5
- Add SAPI used to events
- Add a way to cleanup error and exception handlers HOT 7
- Improve debugging experience
- Add support for `AWS_LAMBDA_FUNCTION_VERSION` env var
- [3.x] Symfony HTTP Client in transport silently upgrades to HTTP/2 and makes HttpTransport fail HOT 1
- Possibility to implement memory limit/hooks for cli / infinite commands HOT 2
- traceparent header missing trace-flags HOT 2
- Initialize the SDK using php auto-prepend-file HOT 1
- `TransactionIntegration` should always set a transaction
- Compile Error: Declaration of Http\Message\Encoding\FilteredStream::seek(int $offset, int $whence = Http\Message\Encoding\SEEK_SET): void must be compatible with PsrExt\Http\Message\StreamInterface::seek($offset, $whence = NULL) HOT 8
- Make it clear in the docs how `send_default_pii`detects "personally identifiable information"
- Metrics Rate Limits
- Ability to filter request input from being sent to Sentry HOT 4
- Feature request: User feedback capturing feature HOT 1
- Deprecated: Use of "static" in callables is deprecated in /app/vendor/sentry/sentry/src/Serializer/AbstractSerializer.php on line 264 HOT 6
- Metrics Normalization
- Strings that happen to be a php function are reported as a callable
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 sentry-php.