Network Instrumentation
Generates: Spans
Automatically instruments HTTP requests made via fetch, XMLHttpRequest, and axios.
How It Works
Pulse React Native SDK intercepts XMLHttpRequest (XHR) to automatically capture all HTTP requests:
fetch()API - In React Native,fetch()internally usesXMLHttpRequestXMLHttpRequest- Direct XHR calls- Axios - Uses
XMLHttpRequestinternally
Each network request automatically captures HTTP method, URL, status code, request type, and error information. See the Attributes section below for complete details.
Configuration
Network instrumentation is enabled by default. You can disable it if needed:
Pulse.start({
autoDetectNetwork: true // Enabled by default
});
When autoDetectNetwork: false, network requests are not automatically tracked. No spans are created for HTTP requests.
Note: You can still manually instrument network requests using Custom Spans.
Generated Telemetry
Type: Span
Span Name: HTTP {method} (e.g., HTTP GET, HTTP POST)
Span Kind: INTERNAL
Attributes
Network-Specific Attributes
| Attribute | Description | Example | Always Present |
|---|---|---|---|
pulse.type | Instrumentation type with Network code | "network.200" | ✅ Yes |
http.method | HTTP method | "GET", "POST" | ✅ Yes |
http.url | Normalized request URL. See URL Normalization for details on how URLs are normalized. | "https://api.example.com/users/[redacted]" | ✅ Yes |
http.request.type | Request type | "xmlhttprequest" (all requests, including fetch and Axios) | ✅ Yes |
http.scheme | URL scheme | "https" | ⚠️ Only if URL is parseable |
http.host | Request hostname | "api.example.com" | ⚠️ Only if URL is parseable |
http.target | Request path + query | "/users/123" or "/api/users?id=123" | ⚠️ Only if URL is parseable |
net.peer.name | Server hostname | "api.example.com" | ⚠️ Only if URL is parseable |
net.peer.port | Port number | 8080 | ⚠️ Only if URL contains port |
http.status_code | Response status code | 200, 404, 500 | ⚠️ Only if response received |
platform | React Native platform | "android", "ios", "web" | ✅ Yes |
Error Attributes (on failure)
| Attribute | Description | Example |
|---|---|---|
error | Error flag | true |
Note: When a network request fails (HTTP error status codes 4xx/5xx or network failures), the span includes
error: trueand thehttp.status_code(if available). Network failures may havehttp.status_code: 0or missing status code.
URL Normalization
The Pulse React Native SDK automatically normalizes URLs in the http.url attribute to protect sensitive data and improve aggregation. The normalization process is identical to the Android SDK implementation.
For detailed information about URL normalization, including the normalization patterns, rationale, and examples, see the URL Normalization section in the Android SDK documentation.
Sample Payload: Successful Network Request
{
"name": "HTTP GET",
"kind": "INTERNAL",
"startTimeUnixNano": "1732735072000000000",
"endTimeUnixNano": "1732735072427640000",
"duration": "427.64ms",
"attributes": {
"pulse.type": "network",
"http.method": "GET",
"http.url": "https://jsonplaceholder.typicode.com/comments/1",
"http.scheme": "https",
"http.host": "jsonplaceholder.typicode.com",
"http.target": "/comments/1",
"http.status_code": 200,
"http.request.type": "xmlhttprequest",
"net.peer.name": "jsonplaceholder.typicode.com",
"platform": "android",
"service.name": "PulseReactNativeOtelExample",
"service.version": "1.0_1",
"device.manufacturer": "Google",
"device.model.name": "sdk_gphone64_arm64",
"os.name": "Android",
"os.version": "16",
"network.connection.type": "cell",
"network.carrier.name": "T-Mobile",
"session.id": "e19b517c705f78d5937c38005259ee1f"
}
}
Note:
http.request.typeis always"xmlhttprequest"because all requests (includingfetch()and Axios) are intercepted via XHR in React Native.
Sample Payload: Failed Network Request (404)
{
"name": "HTTP GET",
"kind": "INTERNAL",
"status": "ERROR",
"startTimeUnixNano": "1732735075000000000",
"endTimeUnixNano": "1732735075135340000",
"duration": "135.34ms",
"attributes": {
"pulse.type": "network",
"http.method": "GET",
"http.url": "https://jsonplaceholder.typicode.com/posts/[redacted]",
"http.scheme": "https",
"http.host": "jsonplaceholder.typicode.com",
"http.target": "/posts/999999",
"http.status_code": 404,
"http.request.type": "xmlhttprequest",
"net.peer.name": "jsonplaceholder.typicode.com",
"error": true,
"platform": "android",
"service.name": "PulseReactNativeOtelExample",
"service.version": "1.0_1",
"device.manufacturer": "Google",
"device.model.name": "sdk_gphone64_arm64",
"os.name": "Android",
"os.version": "16",
"network.connection.type": "cell",
"network.carrier.name": "T-Mobile",
"session.id": "e19b517c705f78d5937c38005259ee1f"
}
}
Note: HTTP error status codes (4xx, 5xx) result in spans with
status: "ERROR"and includeerror: true. Network failures (connection errors, timeouts) also includeerror: trueand may havehttp.status_code: 0or missing status code.
Global Attributes
All network spans include global attributes (service, device, OS, session, etc.). See Global Attributes for complete list.