Skip to content

Commit

Permalink
Add Agent Version to Weasel Beacons (#50)
Browse files Browse the repository at this point in the history
* Added weasel version in beacon.v

* Modified types.js and vars.js

* Update README.md

* Update README.md

* Update package.json for test purpose only

* Update README.md

* Modified for pipeline test purpose

* using beacon.agv to store agentVersion

* Added placeholder for agentVersion

* Updated comment

* updated comments

* Updated agentVersion placeholder

* Updated changelog.md with 1.6.6

* Updated 1.6.6 in package.json
  • Loading branch information
Gouri Hariharan authored and GitHub Enterprise committed Apr 8, 2024
1 parent 9651426 commit a1004c7
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

# 1.6.6
- Read version from package.json to update agentVersion variable.

# 1.6.5
- Added fragment as user configurable. Support for case when user wants to redact sensitive information in url fragment.

Expand Down
1 change: 1 addition & 0 deletions lib/commonBeaconProperties.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export function addCommonBeaconProperties(beacon: Beacon) {
beacon['sid'] = vars.sessionId;
beacon['ww'] = win.innerWidth;
beacon['wh'] = win.innerHeight;
beacon['agv'] = vars.agentVersion;
// Google Closure compiler is not yet aware of these globals. Make sure it doesn't
// mangle them.
if (nav['connection'] && nav['connection']['effectiveType']) {
Expand Down
5 changes: 4 additions & 1 deletion lib/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ export interface Beacon {

// Meta data
// m_abc: string,
[key: string]: ?number|?string
[key: string]: ?number|?string,

// Agent Version
agv: ?string
}

export interface BeaconWithResourceTiming extends Beacon {
Expand Down
5 changes: 5 additions & 0 deletions lib/vars.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,9 @@ const defaultVars: {
// eum('reportingBackends', [{reportingUrl: '//eum.example.com', key: 'key'}]);
reportingBackends: ReportingBackend[],

//The version of Weasel agent.
agentVersion: ?string,

// Whether or not weasel should generate dedicated custom events on webvital metrics
// these custom events is more reliable than webvitals in PageLoad beacon, as we
// will not wait for so long in PageLoad beacon, with custom events, these metrics
Expand Down Expand Up @@ -354,6 +357,8 @@ const defaultVars: {
fragment: [],
headersToCapture: [],
reportingBackends: [],
agentVersion: '0.0.0',
//0.0.0 will be replaced with version from package.json
webvitalsInCustomEvent: false
};

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.6.5",
"version": "1.6.6",
"name": "@instana/weasel",
"description": "Collect end-user data",
"main": "lib/index.js",
Expand Down

0 comments on commit a1004c7

Please sign in to comment.