Skip to content

Commit

Permalink
user agent attribute added
Browse files Browse the repository at this point in the history
  • Loading branch information
aritro66 committed May 30, 2024
1 parent 66e0cb1 commit 9c469b8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/web/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,10 @@ export const SplunkRum: SplunkOtelWebType = {
// enabled: false prevents registerInstrumentations from enabling instrumentations in constructor
// they will be enabled in registerInstrumentations
const pluginDefaults = { ignoreUrls, enabled: false };

let userAgent = ""
if(window.navigator){
userAgent=window.navigator.userAgent
}
const resourceAttrs: ResourceAttributes = {
...SDK_INFO,
[SemanticResourceAttributes.TELEMETRY_SDK_NAME]: '@splunk/otel-web',
Expand All @@ -428,6 +431,7 @@ export const SplunkRum: SplunkOtelWebType = {
'splunk.rumVersion': VERSION,
'splunk.scriptInstance': instanceId,
'app': applicationName,
'userAgent': userAgent
};

const syntheticsRunId = getSyntheticsRunId();
Expand Down

0 comments on commit 9c469b8

Please sign in to comment.