Skip to content
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

Include service URL and request method in r11s request errors #22851

Merged

Conversation

kian-thompson
Copy link
Contributor

@kian-thompson kian-thompson commented Oct 18, 2024

Troubleshooting live-site issues and customer reported issues will become easier. Ex: If Container creation failures have service URL and response code, it'll be easier to identify point of failure and come-up with a fix to mitigate/fix the incident.

This gives AFR a good idea about the APIs which are failing, which cluster it was going to, and which cluster group it was going to. It helps AFR correlate the errors on the server better.

Examples

Here are some examples of request calls. Only the bolded parts can be logged, and the first line of each entry below is just the type of request being made (no need to log it):

CreateDocument (or CreateContainer)
POST https://us.fluidrelay.azure.com/documents/someId

Connect
GET https://alfred.southcentralus-1.fluidrelay.azure.com/socket.io/?documentId=someId&tenantId=someId&EIO=4&transport=websocket

GetDelta
GET https://alfred.southcentralus-1.fluidrelay.azure.com/deltas/someId/someId?from=0&to=2001

GetSummary
GET https://historian.southcentralus-1.fluidrelay.azure.com/repos/someId/git/summaries/latest?token=someToken&disableCache=true

PostSummary
POST https://historian.southcentralus-1.fluidrelay.azure.com/repos/someId/git/summaries?token=someToken

FindSessionFirst Request
POST https://alfred.southcentralus-1.fluidrelay.azure.com/documents/someId/session/someId

Fixes AB#18452

@kian-thompson kian-thompson requested review from manishgargd, arikt-ms, a team, pragya91, markfields, jatgarg, tyler-cai-microsoft, rajatch-ff and MarioJGMsoft and removed request for a team October 18, 2024 23:46
@github-actions github-actions bot added area: driver Driver related issues base: main PRs targeted against main branch labels Oct 18, 2024
Copy link
Collaborator

@msfluid-bot msfluid-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Coverage Summary

↓ packages.drivers.driver-base.src:
Line Coverage Change: -0.37%    Branch Coverage Change: 0.11%
Metric NameBaseline coveragePR coverageCoverage Diff
Branch Coverage 85.95% 86.06% ↑ 0.11%
Line Coverage 81.79% 81.42% ↓ -0.37%
↑ packages.drivers.routerlicious-driver.src:
Line Coverage Change: 0.22%    Branch Coverage Change: 2.13%
Metric NameBaseline coveragePR coverageCoverage Diff
Branch Coverage 74.66% 76.79% ↑ 2.13%
Line Coverage 54.33% 54.55% ↑ 0.22%

Baseline commit: 199b9d0
Baseline build: 302875
Happy Coding!!

Code coverage comparison check passed!!

@msfluid-bot
Copy link
Collaborator

msfluid-bot commented Oct 19, 2024

@fluid-example/bundle-size-tests: +910 Bytes
Metric NameBaseline SizeCompare SizeSize Diff
aqueduct.js 462.72 KB 462.76 KB +35 Bytes
azureClient.js 560.3 KB 560.94 KB +649 Bytes
connectionState.js 724 Bytes 724 Bytes No change
containerRuntime.js 261.67 KB 261.68 KB +14 Bytes
fluidFramework.js 405.97 KB 405.98 KB +14 Bytes
loader.js 134.16 KB 134.18 KB +14 Bytes
map.js 42.46 KB 42.46 KB +7 Bytes
matrix.js 148.29 KB 148.29 KB +7 Bytes
odspClient.js 526.83 KB 526.88 KB +49 Bytes
odspDriver.js 97.84 KB 97.86 KB +21 Bytes
odspPrefetchSnapshot.js 42.81 KB 42.82 KB +14 Bytes
sharedString.js 164.48 KB 164.49 KB +7 Bytes
sharedTree.js 396.43 KB 396.43 KB +7 Bytes
Total Size 3.32 MB 3.32 MB +910 Bytes

Baseline commit: 199b9d0

Generated by 🚫 dangerJS against 3e422df

if (path !== undefined) {
// Extract the first portion of the path and explicitly match it to known path names
const pathMatch = path.match(/^\/?([^/]+)/);
if (pathMatch && [socketIoPath, "repos", "deltas", "documents"].includes(pathMatch[1])) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because there are multiple urls that start with the same path segment (i.e. "documents", "repos") and have the same HTTP method we might need some additional information logged to be able to differentiate between those (i.e. total segment length, etc.). @manishgargd to comment if that is really necessary for this task.

@arikt-ms
Copy link
Contributor

I assume the response status code and method are already being logged, correct ?

Copy link
Contributor

@tyler-cai-microsoft tyler-cai-microsoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kian-thompson kian-thompson merged commit 2f1175f into microsoft:main Oct 29, 2024
29 checks passed
@kian-thompson kian-thompson deleted the 18452-include-url-r11s-errors branch October 29, 2024 21:45
kian-thompson added a commit that referenced this pull request Oct 31, 2024
We can add more portions of the URL path on r11s request errors. To
protect against logging IDs in the URL, any path portion that does not
explicitly match the list of known paths will be replaced with
`REDACTED`.

Continuation of #22851

Fixes
[AB#22156](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/22156)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: driver Driver related issues base: main PRs targeted against main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants