diff --git a/CHANGELOG.md b/CHANGELOG.md index 46e078686..a436dd1f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/lib/commonBeaconProperties.js b/lib/commonBeaconProperties.js index 371182a42..609bb0a2a 100644 --- a/lib/commonBeaconProperties.js +++ b/lib/commonBeaconProperties.js @@ -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']) { diff --git a/lib/types.js b/lib/types.js index 01fa7c2bf..a6c4a1261 100644 --- a/lib/types.js +++ b/lib/types.js @@ -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 { diff --git a/lib/vars.js b/lib/vars.js index 4a8d9b0d8..e408420f5 100644 --- a/lib/vars.js +++ b/lib/vars.js @@ -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 @@ -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 }; diff --git a/package.json b/package.json index 24007e956..61faf3d61 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "1.6.5", + "version": "1.6.6", "name": "@instana/weasel", "description": "Collect end-user data", "main": "lib/index.js",