Skip to main content

Global Attributes

Global attributes are automatically attached to all telemetry data (spans, logs, events) throughout your application. These provide essential context about the device, OS, app, and environment.

How Global Attributes Work

Global attributes appear in two places within telemetry payloads:

  • attributes object - Session, network, screen, and custom React Native attributes
  • resources object - Device, OS, app, and SDK information from the native platform

All these attributes are automatically collected by the SDK and included with every piece of telemetry.

Automatic Attributes

The following attributes are automatically included in all telemetry:

Device Information

AttributeDescriptionExample
device.manufacturerDevice manufacturer"Google", "Samsung"
device.model.nameDevice model name"Pixel 7", "Galaxy S23"
device.model.identifierDevice model identifier"sdk_gphone64_arm64"

Operating System

AttributeDescriptionExample
os.nameOperating system name"Android"
os.typeOS type"linux"
os.versionOS version"16", "13"
os.descriptionFull OS description"BE2A.250530.026.D1"
android.os.api_levelAndroid API level"36", "33"

Application

AttributeDescriptionExample
service.nameApplication name"MyApp"
service.versionApp version with build"1.0_123"
app.build_nameApp build name"1.0_1"
app.build_idApp build ID"123"

SDK Information

AttributeDescriptionExample
rum.sdk.versionPulse SDK version"0.16.0-alpha"
telemetry.sdk.nameTelemetry SDK name"opentelemetry"
telemetry.sdk.languageSDK language"java"
telemetry.sdk.versionOpenTelemetry version"1.54.1"

Network

AttributeDescriptionExample
network.connection.typeConnection type"cell", "wifi"
network.carrier.nameMobile carrier"T-Mobile", "Verizon"
network.carrier.mccMobile country code"310"
network.carrier.mncMobile network code"260"
network.carrier.iccISO country code"us"

Session & Screen

AttributeDescriptionExample
session.idUnique session ID"dce09977c69b0a5c15aa5fd01f817514"
screen.nameCurrent screen/activity"MainActivity", "ScreenStackFragment"

Note: These attributes are automatically collected by the native platform SDK and cannot be modified from React Native. To customize native global attributes, see the Android SDK configuration.

Custom Global Attributes

Add your own global attributes that will be included in all telemetry:

import { Pulse } from '@horizoneng/pulse-react-native';

// Set custom attributes
Pulse.setGlobalAttribute('environment', 'production');
Pulse.setGlobalAttribute('releaseChannel', 'beta');
Pulse.setGlobalAttribute('featureFlags', 'new-checkout,dark-mode');

Once set, these attributes are automatically included in all subsequent spans, events, and logs.

Common Use Cases

Environment Information:

Pulse.setGlobalAttribute('environment', __DEV__ ? 'development' : 'production');
Pulse.setGlobalAttribute('releaseChannel', 'production'); // or 'beta', 'staging'

Build Metadata:

import DeviceInfo from 'react-native-device-info';

Pulse.setGlobalAttribute('appVersion', DeviceInfo.getVersion());
Pulse.setGlobalAttribute('buildNumber', DeviceInfo.getBuildNumber());

Feature Flags:

Pulse.setGlobalAttribute('darkModeEnabled', true);
Pulse.setGlobalAttribute('experimentalFeatures', 'checkout-v2,payments-v3');

User Segments:

Pulse.setGlobalAttribute('userTier', 'premium');
Pulse.setGlobalAttribute('region', 'north-america');

Attribute Priority

Event-specific attributes override global attributes when keys conflict:

Pulse.setGlobalAttribute('environment', 'production');

// This event's 'environment' will be 'staging', not 'production'
Pulse.trackEvent('test_event', {
environment: 'staging'
});

Scope

React Native Telemetry: Custom global attributes set via setGlobalAttribute() apply to all telemetry originating from React Native (events, custom spans, manual error reports).

Native Android Telemetry: Native events (ANR, frozen frames, activity lifecycle) automatically include the device, OS, and app attributes listed above, but not custom attributes set from React Native. To set global attributes for native telemetry, see Android Global Attributes.