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

fix: keep only necessary fields for network info #467

Merged

Conversation

vigneshshanmugam
Copy link
Member

@vigneshshanmugam vigneshshanmugam commented Mar 9, 2022

  • fix remove unused fields from network information #466
  • We use only the relevant fields that are shown on the UI and drop all the other fields that increases the size of the network document. example- san_list from certificates.
  • Benchmarks with before/after this PR
Website - https://www.elastic.co
Before - 1795494 bytes
After - 1207272 bytes


Website - https://www.cnn.com/
Before - 2492815 bytes
After - 1895130 bytes

Website - recaptcha which has huge SAN list
Before - 1101419 bytes
After - 440826 bytes

Yields a savings of 60kB approx. for every synthetics test run.

@apmmachine
Copy link
Collaborator

apmmachine commented Mar 9, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-03-13T17:04:04.978+0000

  • Duration: 15 min 16 sec

Test stats 🧪

Test Results
Failed 0
Passed 148
Skipped 2
Total 150

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

Copy link
Contributor

@andrewvc andrewvc left a comment

Choose a reason for hiding this comment

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

Left some questions, mostly looking good! I still need to test against a kibana instance (unless someone else gets to it first)

timestamp: 1612482095137858,
url: 'https://vigneshh.in/',
browser: { name: 'HeadlessChrome', version: '94.0.4595.0' },
step: null,
Copy link
Contributor

Choose a reason for hiding this comment

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

Did we not actually use the step info in the UI? I had thought we did. Even if this is the case, this seems really useful to include for ad-hoc usage by users.

Copy link
Member Author

Choose a reason for hiding this comment

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

We do, I just removed from the fixture and only for the tests as there is none for this test.

__tests__/fixtures/networkinfo.ts Show resolved Hide resolved
bytes: postData?.length || 0,
},
response: {
statusCode: -1,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we set this to -1 vs null

Copy link
Member Author

Choose a reason for hiding this comment

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

explained below. #467 (comment)

type,
method,
requestSentTime: timestamp,
status: -1,
Copy link
Contributor

Choose a reason for hiding this comment

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

We previously set this to 0, also, why not null? It'd be great to have a comment somewhere nearby explaining these numeric values.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmmm good point, status: 0 denotes a successful response when the browser was having CORS issue so to avoid mistaking it for the aborted requests, I have set it to -1 which feels right.

null would denote a separate type. Keeping number type seems better for status codes.

src/plugins/network.ts Show resolved Hide resolved
@andrewvc
Copy link
Contributor

Completed manual testing against a simple site, touring the Uptime browser UI nothing seems to be missing.

src/plugins/network.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@dominiqueclarke dominiqueclarke left a comment

Choose a reason for hiding this comment

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

LGTM. Manual testing completed with heartbeat 8.2.0 using inline browser monitor.

@vigneshshanmugam vigneshshanmugam merged commit bd9481b into elastic:main Mar 14, 2022
@vigneshshanmugam vigneshshanmugam deleted the allowlist-network-fields branch March 14, 2022 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

remove unused fields from network information
4 participants