@@ -156,12 +156,23 @@ export const SplunkRum: SplunkRumType = {
156156 nativeSdkConf . beaconEndpoint = config . beaconEndpoint ;
157157 }
158158
159+ const sessionId = getSessionId ( ) ;
159160 nativeSdkConf . rumAccessToken = config . rumAccessToken ;
160161 nativeSdkConf . enableDiskBuffering = config . enableDiskBuffering ;
161162 nativeSdkConf . limitDiskUsageMegabytes = config . limitDiskUsageMegabytes ;
162- nativeSdkConf . globalAttributes = { ...getResource ( ) } ;
163+ nativeSdkConf . globalAttributes = {
164+ ...getResource ( ) ,
165+ ...config . globalAttributes ,
166+ 'splunk.rumSessionId' : sessionId ,
167+ app : config . applicationName ,
168+ } ;
169+
170+ if ( config . deploymentEnvironment ) {
171+ nativeSdkConf . globalAttributes [ 'deployment.environment' ] = config . deploymentEnvironment ;
172+ }
173+ // make sure native crashreporter has correct attributes
174+ setGlobalAttributes ( nativeSdkConf . globalAttributes ) ;
163175
164- addGlobalAttributesFromConf ( config ) ;
165176 const provider = new WebTracerProvider ( { } ) ;
166177 provider . addSpanProcessor ( new GlobalAttributeAppender ( ) ) ;
167178 provider . addSpanProcessor (
@@ -196,8 +207,7 @@ export const SplunkRum: SplunkRumType = {
196207 appStartInfo . appStart || appStartInfo . moduleStart ;
197208 }
198209 setNativeSessionId ( getSessionId ( ) ) ;
199- // make sure native crashreporter has correct attributes
200- setGlobalAttributes ( { } ) ;
210+
201211 if ( config . appStartEnabled ) {
202212 const tracer = provider . getTracer ( 'AppStart' ) ;
203213 const nativeInitEnd = Date . now ( ) ;
@@ -238,19 +248,6 @@ export const SplunkRum: SplunkRumType = {
238248 updateLocation : updateLocation ,
239249} ;
240250
241- function addGlobalAttributesFromConf ( config : ReactNativeConfiguration ) {
242- const confAttributes : Attributes = {
243- ...config . globalAttributes ,
244- } ;
245- confAttributes . app = config . applicationName ;
246-
247- if ( config . deploymentEnvironment ) {
248- confAttributes [ 'deployment.environment' ] = config . deploymentEnvironment ;
249- }
250-
251- setGlobalAttributes ( confAttributes ) ;
252- }
253-
254251function updateLocation ( latitude : number , longitude : number ) {
255252 setGlobalAttributes ( {
256253 [ LOCATION_LATITUDE ] : latitude ,
0 commit comments