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. GraphQL requests are automatically detected and enhanced with operation name and type attributes. 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 | Full request URL | "https://api.example.com/users/123" | ✅ 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 |
GraphQL Attributes (for GraphQL requests)
| Attribute | Description | Example | Always Present |
|---|---|---|---|
graphql.operation.name | GraphQL operation name | "GetUser", "CreatePost" | Only if operation name is available |
graphql.operation.type | GraphQL operation type | "query", "mutation", "subscription" | Only if operation type is available |
Note: GraphQL attributes are automatically added when a request is detected as GraphQL. Detection is based on the URL containing
"graphql"(case-insensitive). Attributes are extracted from the request body (POST) or query parameters (GET).
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.
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/999999",
"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.
Sample Payload: GraphQL Request
{
"name": "HTTP POST",
"kind": "INTERNAL",
"startTimeUnixNano": "1732735072000000000",
"endTimeUnixNano": "1732735072427640000",
"duration": "427.64ms",
"attributes": {
"pulse.type": "network",
"http.method": "POST",
"http.url": "https://api.example.com/graphql",
"http.scheme": "https",
"http.host": "api.example.com",
"http.target": "/graphql",
"http.status_code": 200,
"http.request.type": "xmlhttprequest",
"graphql.operation.name": "GetUser",
"graphql.operation.type": "query",
"platform": "android"
}
}
Note: GraphQL requests are automatically detected when the URL contains
"graphql"(case-insensitive). Operation name and type are extracted from the request body (POST) or query parameters (GET).
Global Attributes
All network spans include global attributes (service, device, OS, session, etc.). See Global Attributes for complete list.