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
| Attribute | Description | Example |
|---|---|---|
device.model.identifier | Hardware model string | "iPhone16,1" |
device.model.name | Human-readable model name | "iPhone 15 Pro" |
device.manufacturer | Always "Apple" | "Apple" |
OS
| Attribute | Description | Example |
|---|---|---|
os.name | Always "iOS" | "iOS" |
os.version | OS version | "17.4" |
os.type | Always "darwin" | "darwin" |
App / Service
| Attribute | Description | Example |
|---|---|---|
service.name | App bundle display name | "MyApp" |
service.version | App version string | "2.1.0" |
app.build_id | CFBundleVersion | "42" |
Session
| Attribute | Description | Example |
|---|---|---|
session.id | Current session identifier | "f40364c92b85ec0c19c35a65be42b97f" |
Network (when includeNetworkAttributes is enabled)
| Attribute | Description | Example |
|---|---|---|
network.connection.type | Connection type | "wifi", "cell", "unavailable" |
network.connection.subtype | Cellular subtype | "lte", "nr" |
Can be disabled via configuration.
Screen (when includeScreenAttributes is enabled)
| Attribute | Description | Example |
|---|---|---|
screen.name | Current 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:
| Type | Swift value |
|---|---|
| String | AttributeValue.string("value") |
| Int | AttributeValue.int(42) |
| Double | AttributeValue.double(1.5) |
| Bool | AttributeValue.bool(true) |
| Array | AttributeValue.array(AttributeArray(values: [...])) |
Pulse.shared.initialize(
endpointBaseUrl: "https://your-backend.com",
apiKey: "your-api-key",
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
- Data Collection Consent — Gate collection behind user consent
- API Reference — Browse all public methods