-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat: queue time metric #16030
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
feat: queue time metric #16030
Changes from 18 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
ed1cb82
add last_updated information to develop docs
dingsdax 16ad85f
fix TS null vs undefined
dingsdax 4e916b6
Lint
dingsdax 2fa50bb
Merge branch 'master' into develop_doc_last_updated
dingsdax 928a878
[getsentry/action-github-commit] Auto commit
getsantry[bot] 60325f6
[getsentry/action-github-commit] Auto commit
getsantry[bot] 2261774
Fix for only showing on develop docs
dingsdax 353c895
[getsentry/action-github-commit] Auto commit
getsantry[bot] f387289
return new object copies, preventing reference sharing in cached meta…
dingsdax df13418
[getsentry/action-github-commit] Auto commit
getsantry[bot] af1d879
Add some debug code
dingsdax 6733525
Update getGitMetadata.ts
dingsdax dbee391
Capture queue time docs
dingsdax 8a1891a
Merge branch 'master' into queue-time-metric
dingsdax 340aa90
[getsentry/action-github-commit] Auto commit
getsantry[bot] d421c30
[getsentry/action-github-commit] Auto commit
getsantry[bot] 72c0502
remove unrelated code
dingsdax de260a4
Merge branch 'master' into queue-time-metric
dingsdax 9dec483
Apply suggestions from code review
dingsdax f7ddb6f
Fix attribute name, simplify options
dingsdax 7381a33
Merge branch 'master' into queue-time-metric
dingsdax 1d55734
Merge branch 'master' into queue-time-metric
dingsdax 100bfc5
docs(ruby): Review and fix queue time capture docs
dingsdax 5894dc4
fix(ruby): Use PlatformLink for queue time capture reference in options
dingsdax faf703b
Merge branch 'master' into queue-time-metric
dingsdax d26bcc0
Merge branch 'master' into queue-time-metric
dingsdax File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| ## Automatic Queue Time Capture | ||
|
|
||
| The Ruby SDK automatically captures queue time for Rack-based applications when the `X-Request-Start` header is present. This measures how long requests wait in the web server queue (e.g., waiting for a Puma thread) before your application begins processing them. | ||
|
|
||
| Queue time is attached to transactions as `http.queue_time_ms` and helps identify server capacity issues. | ||
|
|
||
| ### Setup | ||
|
|
||
| Configure your reverse proxy to add the `X-Request-Start` header: | ||
|
|
||
| **Nginx:** | ||
|
|
||
| ```nginx | ||
| location / { | ||
| proxy_pass http://your-app; | ||
| proxy_set_header X-Request-Start "t=${msec}"; | ||
| } | ||
| ``` | ||
|
|
||
| **HAProxy:** | ||
|
|
||
| ```haproxy | ||
| frontend http-in | ||
| http-request set-header X-Request-Start t=%Ts%ms | ||
| ``` | ||
|
|
||
| **Heroku:** The header is automatically set by Heroku's router. | ||
|
|
||
| ### How It Works | ||
|
|
||
| The SDK: | ||
|
|
||
| 1. Reads the `X-Request-Start` header timestamp from your reverse proxy | ||
| 2. Calculates the time difference between the header timestamp and when the request reaches your application | ||
| 3. Subtracts `puma.request_body_wait` (if present) to exclude time spent waiting for slow client uploads | ||
| 4. Attaches the result as `http.queue_time_ms` to the transaction | ||
|
|
||
| ### Disable Queue Time Capture | ||
|
|
||
| If you don't want queue time captured, disable it in your configuration: | ||
|
|
||
| ```ruby | ||
| Sentry.init do |config| | ||
| config.capture_queue_time = false | ||
| end | ||
| ``` | ||
|
|
||
| ### Viewing Queue Time | ||
|
|
||
| Queue time appears in the Sentry transaction details under the "Data" section as `http.queue_time_ms` (measured in milliseconds). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.