Skip to content

feat: Remove unused data from session trace requests #570

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 2 commits into from
Jun 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 1 addition & 10 deletions src/features/session_trace/aggregate/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
*/
import { registerHandler } from '../../../common/event-emitter/register-handler'
import { HarvestScheduler } from '../../../common/harvest/harvest-scheduler'
import { stringify } from '../../../common/util/stringify'
import { parseUrl } from '../../../common/url/parse-url'
import { getConfigurationValue, getInfo, getRuntime } from '../../../common/config/config'
import { now } from '../../../common/timing/now'
Expand Down Expand Up @@ -325,18 +324,10 @@ export class Aggregate extends AggregateBase {
this.trace = {}
this.nodeCount = 0

const stnInfo = {
return {
qs: { st: String(getRuntime(this.agentIdentifier).offset) },
body: { res: stns }
}
if (!this.ptid) { // send custom and user attributes on the very first ST harvest only
const { userAttributes, atts, jsAttributes } = getInfo(this.agentIdentifier)
stnInfo.qs.ua = userAttributes
stnInfo.qs.at = atts
const ja = stringify(jsAttributes)
stnInfo.qs.ja = ja === '{}' ? null : ja
}
return stnInfo
}

smearEvtsByOrigin (name) {
Expand Down
4 changes: 0 additions & 4 deletions tests/functional/stn/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,15 @@ const testDriver = require('../../../tools/jil/index')
let supported = testDriver.Matcher.withFeature('stn')

testDriver.test('posts session traces', supported, function (t, browser, router) {
t.plan(5)

let rumPromise = router.expectRum()
let resourcePromise = router.expectResources()
let loadPromise = browser.get(router.assetURL('lotsatimers.html')).waitForFeature('loaded')

Promise.all([resourcePromise, rumPromise, loadPromise]).then(([{ request: { query } }]) => {
t.ok(+query.st > 1408126770885, `Got start time ${query.st}`)
t.notok(query.ptid, 'No ptid on first harvest')
t.equal(query.ja, '{"aargh":"somanytimers"}', 'custom javascript attributes (on stn first post)')
return router.expectResources().then(({ request: { query } }) => {
t.ok(query.ptid, `ptid on second harvest ${query.ptid}`)
t.equal(query.ja, undefined, 'no javascript attributes (on stn second post)')
t.end()
})
}).catch(fail)
Expand Down
8 changes: 4 additions & 4 deletions tests/functional/xhr/ajax-events.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ testDriver.test('Disabled ajax events', function (t, browser, router) {
})

testDriver.test('capturing XHR ajax events', function (t, browser, router) {
const ajaxPromise = router.expectAjaxEvents(5000)
const ajaxPromise = router.expectAjaxEvents(10000)
const rumPromise = router.expectRum()
const loadPromise = browser.safeGet(router.assetURL('xhr-outside-interaction.html', {
loader: 'spa',
init: {
ajax: {
harvestTimeSeconds: 2,
harvestTimeSeconds: 5,
enabled: true
}
}
Expand All @@ -53,8 +53,8 @@ testDriver.test('capturing XHR ajax events', function (t, browser, router) {

testDriver.test('capturing large payload of XHR ajax events', function (t, browser, router) {
const ajaxPromises = Promise.all([
router.expectAjaxEvents(8000),
router.expectAjaxEvents(16000)
router.expectAjaxEvents(10000),
router.expectAjaxEvents(20000)
])
const rumPromise = router.expectRum()
const loadPromise = browser.safeGet(router.assetURL('xhr-large-payload.html', {
Expand Down
16 changes: 8 additions & 8 deletions tools/browsers-lists/browsers-supported.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
"browserName": "chrome",
"platformName": "Windows 11",
"platform": "Windows 11",
"version": "104",
"browserVersion": "104"
"version": "105",
"browserVersion": "105"
},
{
"browserName": "chrome",
"platformName": "Windows 11",
"platform": "Windows 11",
"version": "107",
"browserVersion": "107"
"version": "108",
"browserVersion": "108"
},
{
"browserName": "chrome",
Expand All @@ -34,15 +34,15 @@
"browserName": "MicrosoftEdge",
"platformName": "Windows 11",
"platform": "Windows 11",
"version": "104",
"browserVersion": "104"
"version": "105",
"browserVersion": "105"
},
{
"browserName": "MicrosoftEdge",
"platformName": "Windows 11",
"platform": "Windows 11",
"version": "107",
"browserVersion": "107"
"version": "108",
"browserVersion": "108"
},
{
"browserName": "MicrosoftEdge",
Expand Down