Skip to main content

Global Attributes

Attach contextual metadata to every span and log the SDK emits.

Automatic Attributes​

The SDK automatically attaches the following resource attributes to all telemetry — no configuration needed:

Device​

AttributeDescriptionExample
device.model.identifierHardware model string"iPhone16,1"
device.model.nameHuman-readable model name"iPhone 15 Pro"
device.manufacturerAlways "Apple""Apple"

OS​

AttributeDescriptionExample
os.nameAlways "iOS""iOS"
os.versionOS version"17.4"
os.typeAlways "darwin""darwin"

App / Service​

AttributeDescriptionExample
service.nameApp bundle display name"MyApp"
service.versionApp version string"2.1.0"
app.build_idCFBundleVersion"42"

Session​

AttributeDescriptionExample
session.idCurrent session identifier"f40364c92b85ec0c19c35a65be42b97f"

Network (when includeNetworkAttributes is enabled)​

AttributeDescriptionExample
network.connection.typeConnection type"wifi", "cell", "unavailable"
network.connection.subtypeCellular subtype"lte", "nr"

Can be disabled via configuration.

Screen (when includeScreenAttributes is enabled)​

AttributeDescriptionExample
screen.nameCurrent UIViewController class name"HomeViewController"

Can be disabled via configuration.

Custom Global Attributes​

Pass key/value pairs in globalAttributes to attach your own metadata to every span and log. Supported value types:

TypeSwift value
StringAttributeValue.string("value")
IntAttributeValue.int(42)
DoubleAttributeValue.double(1.5)
BoolAttributeValue.bool(true)
ArrayAttributeValue.array(AttributeArray(values: [...]))
Pulse.shared.initialize(

apiKey: "your-api-key",
dataCollectionState: .allowed,
globalAttributes: [
"environment": AttributeValue.string("production"),
"app.version": AttributeValue.string("2.1.0"),
"app.build": AttributeValue.int(123),
"app.is_debug": AttributeValue.bool(false),
"feature.flags": AttributeValue.array(AttributeArray(values: [
AttributeValue.string("dark_mode"),
AttributeValue.string("new_checkout"),
])),
]
)

Custom global attributes are injected when includeGlobalAttributes is true (the default). Disable via:

configuration: { config in
config.disableGlobalAttributes()
}

Next Steps​