Skip to content

Commit ae83d01

Browse files
Add docs for network change (open-telemetry#789)
* add docs for network change * Update instrumentation/network/README.md Co-authored-by: Manoel Aranda Neto <[email protected]> --------- Co-authored-by: Manoel Aranda Neto <[email protected]>
1 parent ed83d5e commit ae83d01

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Some of the additional features provided include:
5454

5555
* [Crash reporting](./instrumentation/crash/)
5656
* [ANR detection](./instrumentation/anr/)
57-
* Network change detection
57+
* [Network change detection](./instrumentation/network/)
5858
* Android [Activity lifecycle instrumentation](./instrumentation/activity/)
5959
* Android Fragment lifecycle monitoring
6060
* Access to the OpenTelemetry APIs for manual instrumentation

instrumentation/network/README.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
# Network Change Instrumentation
3+
4+
Status: experimental
5+
6+
Android applications are typically deployed on mobile devices. These mobile devices
7+
have the ability to move between networks, and sometimes a network change can
8+
have an impact on application performance characteristics. This instrumentation
9+
will generate telemetry when the network changes, as detected
10+
via [ConnectivityManager.NetworkCallback](https://developer.android.com/reference/android/net/ConnectivityManager.NetworkCallback).
11+
12+
This instrumentation only generates telemetry when the application is in the foreground,
13+
not when the application is backgrounded.
14+
15+
## Telemetry
16+
17+
This instrumentation produces the following telemetry:
18+
19+
### Network Change
20+
21+
* Type: Span
22+
* Name: `network.change`
23+
* Description: This zero-duration span is started and ended when a network change is detected.
24+
* Attributes:
25+
* `network.status`: One of `lost` or `available`.
26+
* `network.connection.type` (semconv) one of `cell`, `wifi`, `wired`, `unavailable`, `unknown`, `vpn`.
27+
28+
Note: This instrumentation supports additional user-configurable `AttributeExtractors` that
29+
may set additional attributes when given a `CurrentNetwork` instance.

0 commit comments

Comments
 (0)