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

feat(rum-core): add network info for all transactions #752

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

vigneshshanmugam
Copy link
Member

@vigneshshanmugam vigneshshanmugam commented Apr 16, 2020

  • fix Need to add support for Network Information. #479
  • All transactions like page-load, route-change and other auto instrumented transactions would include this information by default under transaction page metadata.
  • Errors only include the previous page info and does not include the network info as its not super useful.

Server schema spec - elastic/apm-server#3657

function getNetworkInformation() {
const connection = navigator && navigator.connection

if (!(connection && typeof connection === 'object')) {
Copy link
Contributor

Choose a reason for hiding this comment

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

It's better to not negate the condition and just wrap the following return inside if.

packages/rum-core/src/common/utils.js Show resolved Hide resolved
@@ -211,7 +214,12 @@ describe('Context', () => {
},
...userContext
})

expect(pageloadTr.context.page.netinfo).toEqualOrUndefined({
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO, using toEqualOrUndefined is not a good idea, instead we should detect if the feature that is required for this to work exist and we should add explicit checks for the outcomes. With this matcher we don't know whether the result was undefined because of a bug or because the api is not supported.

Copy link
Member Author

Choose a reason for hiding this comment

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

If i get it right, do you want to test it only for supported browsers? Like we do explicit check like

if (connection) {
  expect(measuredInfo).toBe(actualInfo)? 
}

I was trying to express this using the matcher, May be i missed something. We can also do explicit checks in tests if its confusing.

Copy link
Contributor

@hmdhk hmdhk Apr 27, 2020

Choose a reason for hiding this comment

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

correct! also check the else condition, i.e:

if (connection) {
  expect(measuredInfo).toBe(actualInfo)
} else {
 expect(measuredInfo).toBe(undefined)
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah sounds good 👍

@apmmachine
Copy link
Collaborator

apmmachine commented Apr 28, 2020

💔 Build Failed

Pipeline View Test View Changes Artifacts preview stats

Expand to view the summary

Build stats

  • Build Cause: [Branch indexing]

  • Start Time: 2020-05-06T21:22:12.020+0000

  • Duration: 53 min 44 sec (3163899)

  • Commit: 8d2902b

Test stats 🧪

Test Results
Failed 4
Passed 2093
Skipped 22
Total 2119

Test errors

Expand to view the tests failures

  • Name: Initializing / Stack 8.0.0-SNAPSHOT SauceLabs PR / ErrorLogging should include context info on error – Mobile_Safari_12_1_0_(iOS_12_2_0).ErrorLogging

    • Status: FAILED
    • Age: 4
    • Duration: 0.005
    • Error Details: null
  • Name: Initializing / Stack 8.0.0-SNAPSHOT SauceLabs PR / ErrorLogging should include context info on error – IE_11_0_0_(Windows_8_1_0_0).ErrorLogging

    • Status: FAILED
    • Age: 6
    • Duration: 0.009
    • Error Details: null
  • Name: Initializing / Stack 8.0.0-SNAPSHOT SauceLabs PR / ErrorLogging should include context info on error – Safari_9_1_2_(Mac_OS_X_10_11_6).ErrorLogging

    • Status: FAILED
    • Age: 6
    • Duration: 0.005
    • Error Details: null
  • Name: Initializing / Stack 8.0.0-SNAPSHOT SauceLabs PR / Context should enrich transaction with context info based on type – Chrome_Mobile_39_0_0_(Android_5_1_1).Context

    • Status: FAILED
    • Age: 10
    • Duration: 0.007
    • Error Details: null

Steps errors

Expand to view the steps failures

  • Name: Bundlesize

    • Description: #!/bin/bash set -o pipefail npm run bundlesize|tee bundlesize.txt

    • Result: FAILURE

    • Duration: 1 min 31 sec<

    • Start Time: 2020-05-06T21:33:50.225+0000

  • Name: Start Elastic Stack 8.0.0-SNAPSHOT - @elastic/apm-rum-react - none

    • Description:

    • Result: FAILURE

    • Duration: 5 min 4 sec<

    • Start Time: 2020-05-06T21:42:25.215+0000

  • Name: Start Elastic Stack 8.0.0-SNAPSHOT - @elastic/apm-rum-core - saucelabs

    • Description:

    • Result: FAILURE

    • Duration: 7 min 46 sec<

    • Start Time: 2020-05-06T22:00:08.460+0000

  • Name: Error signal

    • Description:

    • Result: FAILURE

    • Duration: 0 min 0 sec<

    • Start Time: 2020-05-06T22:06:54.626+0000

  • Name: Start Elastic Stack 8.0.0-SNAPSHOT - @elastic/apm-rum-core - saucelabs

    • Description:

    • Result: FAILURE

    • Duration: 4 min 30 sec<

    • Start Time: 2020-05-06T22:07:00.173+0000

  • Name: Error signal

    • Description:

    • Result: FAILURE

    • Duration: 0 min 0 sec<

    • Start Time: 2020-05-06T22:10:30.510+0000

  • Name: Start Elastic Stack 8.0.0-SNAPSHOT - @elastic/apm-rum-core - saucelabs

    • Description:

    • Result: FAILURE

    • Duration: 4 min 15 sec<

    • Start Time: 2020-05-06T22:10:37.093+0000

  • Name: Error signal

    • Description:

    • Result: FAILURE

    • Duration: 0 min 0 sec<

    • Start Time: 2020-05-06T22:14:52.102+0000

  • Name: General Build Step

    • Description: [2020-05-06T22:14:54.524Z] Archiving artifacts
      The test failed

    • Result: FAILURE

    • Duration: 0 min 0 sec<

    • Start Time: 2020-05-06T22:14:54.520+0000

Log output

Expand to view the last 100 lines of log output

[2020-05-06T22:14:35.069Z] node-puppeteer         | 	    at UserContext.<anonymous> (webpack:///test/common/context.spec.js:217:1 <- test/common/context.spec.js:2489:45)
[2020-05-06T22:14:35.069Z] node-puppeteer         | 	    at <Jasmine>
[2020-05-06T22:14:35.069Z] node-puppeteer         | Mobile Safari 12.1.0 (iOS 12.2.0) failed specs:
[2020-05-06T22:14:35.069Z] node-puppeteer         |   ErrorLogging > should include context info on error
[2020-05-06T22:14:35.069Z] node-puppeteer         | 	Expected object not to have properties
[2020-05-06T22:14:35.070Z] node-puppeteer         | 	    custom: Object({ line: 7202, column: 23, sourceURL: 'test/error-logging/error-logging.spec.js' })
[2020-05-06T22:14:35.070Z] node-puppeteer         | 	<Jasmine>
[2020-05-06T22:14:35.070Z] node-puppeteer         | 	webpack:///test/error-logging/error-logging.spec.js:172:1 <- test/error-logging/error-logging.spec.js:7205:38
[2020-05-06T22:14:35.070Z] node-puppeteer         | 	<Jasmine>
[2020-05-06T22:14:35.070Z] node-puppeteer         | TOTAL: 4 FAILED, 1267 SUCCESS
[2020-05-06T22:14:39.285Z] node-puppeteer         | npm ERR! code ELIFECYCLE
[2020-05-06T22:14:39.285Z] node-puppeteer         | npm ERR! errno 1
[2020-05-06T22:14:39.285Z] node-puppeteer         | npm ERR! @elastic/apm-rum-core@5.2.0 script: `node ../../dev-utils/run-script.js "runUnitTests" "packages/rum-core"`
[2020-05-06T22:14:39.285Z] node-puppeteer         | npm ERR! Exit status 1
[2020-05-06T22:14:39.285Z] node-puppeteer         | npm ERR! 
[2020-05-06T22:14:39.285Z] node-puppeteer         | npm ERR! Failed at the @elastic/apm-rum-core@5.2.0 script script.
[2020-05-06T22:14:39.285Z] node-puppeteer         | npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[2020-05-06T22:14:39.285Z] node-puppeteer         | npm WARN Local package.json exists, but node_modules missing, did you mean to install?
[2020-05-06T22:14:39.285Z] node-puppeteer         | npm ERR! A complete log of this run can be found in:
[2020-05-06T22:14:39.285Z] node-puppeteer         | npm ERR!     /app/.npm/_logs/2020-05-06T22_14_38_679Z-debug.log
[2020-05-06T22:14:39.285Z] node-puppeteer         | npm ERR! code ELIFECYCLE
[2020-05-06T22:14:39.285Z] node-puppeteer         | npm ERR! errno 1
[2020-05-06T22:14:39.285Z] node-puppeteer         | npm ERR! @elastic/apm-rum-core@5.2.0 test:unit: `npm run script runUnitTests packages/rum-core`
[2020-05-06T22:14:39.285Z] node-puppeteer         | npm ERR! Exit status 1
[2020-05-06T22:14:39.285Z] node-puppeteer         | npm ERR! 
[2020-05-06T22:14:39.286Z] node-puppeteer         | npm ERR! Failed at the @elastic/apm-rum-core@5.2.0 test:unit script.
[2020-05-06T22:14:39.286Z] node-puppeteer         | npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[2020-05-06T22:14:39.286Z] node-puppeteer         | npm WARN Local package.json exists, but node_modules missing, did you mean to install?
[2020-05-06T22:14:39.286Z] node-puppeteer         | npm ERR! A complete log of this run can be found in:
[2020-05-06T22:14:39.286Z] node-puppeteer         | npm ERR!     /app/.npm/_logs/2020-05-06T22_14_38_697Z-debug.log
[2020-05-06T22:14:39.286Z] node-puppeteer         | Sauce Tests Failed NpmRunAllError: "test:unit" exited with 1.
[2020-05-06T22:14:39.286Z] node-puppeteer         |     at /app/node_modules/npm-run-all/lib/run-tasks.js:141:33
[2020-05-06T22:14:39.286Z] node-puppeteer         |     at processTicksAndRejections (internal/process/task_queues.js:97:5) {
[2020-05-06T22:14:39.286Z] node-puppeteer         |   name: undefined,
[2020-05-06T22:14:39.286Z] node-puppeteer         |   code: 1,
[2020-05-06T22:14:39.286Z] node-puppeteer         |   results: [ { name: 'test:unit', code: 1 } ]
[2020-05-06T22:14:39.286Z] node-puppeteer         | }
[2020-05-06T22:14:51.537Z] node-puppeteer         | Closing Sauce Connect Tunnel
[2020-05-06T22:14:51.537Z] node-puppeteer         | Running cleanups: 1
[2020-05-06T22:14:51.537Z] node-puppeteer         | Shutting down
[2020-05-06T22:14:51.537Z] node-puppeteer         | npm ERR! code ELIFECYCLE
[2020-05-06T22:14:51.537Z] node-puppeteer         | npm ERR! errno 1
[2020-05-06T22:14:51.537Z] node-puppeteer         | npm ERR! @elastic/apm-rum-core@5.2.0 script: `node ../../dev-utils/run-script.js "runSauceTests" "packages/rum-core" "true" "test:unit"`
[2020-05-06T22:14:51.537Z] node-puppeteer         | npm ERR! Exit status 1
[2020-05-06T22:14:51.537Z] node-puppeteer         | npm ERR! 
[2020-05-06T22:14:51.537Z] node-puppeteer         | npm ERR! Failed at the @elastic/apm-rum-core@5.2.0 script script.
[2020-05-06T22:14:51.537Z] node-puppeteer         | npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[2020-05-06T22:14:51.538Z] node-puppeteer         | npm WARN Local package.json exists, but node_modules missing, did you mean to install?
[2020-05-06T22:14:51.538Z] node-puppeteer         | npm ERR! A complete log of this run can be found in:
[2020-05-06T22:14:51.538Z] node-puppeteer         | npm ERR!     /app/.npm/_logs/2020-05-06T22_14_51_496Z-debug.log
[2020-05-06T22:14:51.538Z] node-puppeteer         | npm ERR! code ELIFECYCLE
[2020-05-06T22:14:51.538Z] node-puppeteer         | npm ERR! errno 1
[2020-05-06T22:14:51.538Z] node-puppeteer         | npm ERR! @elastic/apm-rum-core@5.2.0 test:sauce: `npm run script runSauceTests packages/rum-core true test:unit`
[2020-05-06T22:14:51.538Z] node-puppeteer         | npm ERR! Exit status 1
[2020-05-06T22:14:51.538Z] node-puppeteer         | npm ERR! 
[2020-05-06T22:14:51.538Z] node-puppeteer         | npm ERR! Failed at the @elastic/apm-rum-core@5.2.0 test:sauce script.
[2020-05-06T22:14:51.538Z] node-puppeteer         | npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[2020-05-06T22:14:51.538Z] node-puppeteer         | npm WARN Local package.json exists, but node_modules missing, did you mean to install?
[2020-05-06T22:14:51.538Z] node-puppeteer         | npm ERR! A complete log of this run can be found in:
[2020-05-06T22:14:51.538Z] node-puppeteer         | npm ERR!     /app/.npm/_logs/2020-05-06T22_14_51_514Z-debug.log
[2020-05-06T22:14:51.801Z] node-puppeteer         | npm ERR! code ELIFECYCLE
[2020-05-06T22:14:51.801Z] node-puppeteer         | npm ERR! errno 1
[2020-05-06T22:14:51.801Z] node-puppeteer         | npm ERR! @elastic/apm-rum-core@5.2.0 test: `npm run test:sauce`
[2020-05-06T22:14:51.801Z] node-puppeteer         | npm ERR! Exit status 1
[2020-05-06T22:14:51.801Z] node-puppeteer         | npm ERR! 
[2020-05-06T22:14:51.801Z] node-puppeteer         | npm ERR! Failed at the @elastic/apm-rum-core@5.2.0 test script.
[2020-05-06T22:14:51.801Z] node-puppeteer         | npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[2020-05-06T22:14:51.801Z] node-puppeteer         | npm WARN Local package.json exists, but node_modules missing, did you mean to install?
[2020-05-06T22:14:51.801Z] node-puppeteer         | npm ERR! A complete log of this run can be found in:
[2020-05-06T22:14:51.801Z] node-puppeteer         | npm ERR!     /app/.npm/_logs/2020-05-06T22_14_51_534Z-debug.log
[2020-05-06T22:14:51.801Z] node-puppeteer         | lerna ERR! npm run test exited 1 in '@elastic/apm-rum-core'
[2020-05-06T22:14:51.801Z] node-puppeteer         | npm ERR! code ELIFECYCLE
[2020-05-06T22:14:51.801Z] node-puppeteer         | npm ERR! errno 1
[2020-05-06T22:14:51.802Z] node-puppeteer         | npm ERR! elastic-apm-rum@0.0.0-monorepo test: `npm run build && lerna run test --scope=$SCOPE --no-prefix  --concurrency=1`
[2020-05-06T22:14:51.802Z] node-puppeteer         | npm ERR! Exit status 1
[2020-05-06T22:14:51.802Z] node-puppeteer         | npm ERR! 
[2020-05-06T22:14:51.802Z] node-puppeteer         | npm ERR! Failed at the elastic-apm-rum@0.0.0-monorepo test script.
[2020-05-06T22:14:51.802Z] node-puppeteer         | npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[2020-05-06T22:14:51.802Z] node-puppeteer         | 
[2020-05-06T22:14:51.802Z] node-puppeteer         | npm ERR! A complete log of this run can be found in:
[2020-05-06T22:14:51.802Z] node-puppeteer         | npm ERR!     /app/.npm/_logs/2020-05-06T22_14_51_561Z-debug.log
[2020-05-06T22:14:52.064Z] node-puppeteer exited with code 1
[2020-05-06T22:14:52.064Z] Aborting on container exit...
[2020-05-06T22:14:53.202Z] Post stage
[2020-05-06T22:14:53.222Z] Recording test results
[2020-05-06T22:14:54.524Z] Archiving artifacts
[2020-05-06T22:14:54.777Z] Stage "Integration Tests" skipped due to earlier failure(s)
[2020-05-06T22:14:54.824Z] Stage "Benchmarks" skipped due to earlier failure(s)
[2020-05-06T22:14:54.876Z] Stage "Coverage" skipped due to earlier failure(s)
[2020-05-06T22:14:54.927Z] Stage "Release" skipped due to earlier failure(s)
[2020-05-06T22:14:54.950Z] Stage "Release" skipped due to earlier failure(s)
[2020-05-06T22:14:55.001Z] Stage "Release" skipped due to earlier failure(s)
[2020-05-06T22:14:55.079Z] Stage "Opbeans" skipped due to earlier failure(s)
[2020-05-06T22:14:55.330Z] Running on Jenkins in /var/lib/jenkins/workspace/ent-rum_apm-agent-rum-mbp_PR-752
[2020-05-06T22:14:55.386Z] [INFO] getVaultSecret: Getting secrets
[2020-05-06T22:14:55.449Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2020-05-06T22:14:56.183Z] + chmod 755 generate-build-data.sh
[2020-05-06T22:14:56.183Z] + ./generate-build-data.sh https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/apm-agent-rum/apm-agent-rum-mbp/PR-752/ https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/apm-agent-rum/apm-agent-rum-mbp/PR-752/runs/10 FAILURE 3163899
[2020-05-06T22:14:57.094Z] INFO: curl https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/apm-agent-rum/apm-agent-rum-mbp/PR-752/runs/10/steps/?limit=10000 -o steps-info.json
[2020-05-06T22:14:58.005Z] INFO: curl https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/apm-agent-rum/apm-agent-rum-mbp/PR-752/runs/10/tests/?status=FAILED -o tests-errors.json

@hmdhk hmdhk added the blocked label May 4, 2020
@vigneshshanmugam
Copy link
Member Author

On hold till the spec is finalised on the APM Server- More details elastic/apm-server#3918 (comment)

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.

Need to add support for Network Information.
3 participants