Skip to content

[BUG] AI web sdk is using user-agent in request header to determine the OS not reading from context #2590

@AnuragTiwari1

Description

@AnuragTiwari1

Description/Screenshot
I am using Web insight sdk in my react native application and web application. while in web the user agent is getting passed correctly so we are getting OS in application insights as iOS 18.5 for iOS and Android 15 for android phone. same devices when running the react native app is showing just iOS for iPhone and Other for Android.
Steps to Reproduce

  • OS/Browser: React Native application, iOS and android
  • SDK Version [e.g. 22]: 3.3.6
  • How you initialized the SDK:
  const appInsights = new ApplicationInsights({
       config: {
         instrumentationKey: AppConstant.MICROSOFT_APPLICATION_INSIGHT_INSTRUMENTATION_KEY,
         extensions: [RNPlugin],
       }
     });
     appInsights.loadAppInsights();
     appInsights.config.enableAjaxErrorStatusText = true;
     appInsights.config.enableAutoRouteTracking = true;
     appInsights.config.autoTrackPageVisitTime = true;
     appInsights.context.os = {name: 'Android'};

Expected behavior
there should be some way to override this. I see in ai context there is OS.name, I tried setting that as well but it's not respecting it

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions