Skip to content

Commit

Permalink
Add docs for network change (#789)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
breedx-splk and marandaneto authored Feb 3, 2025
1 parent ed83d5e commit ae83d01
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Some of the additional features provided include:

* [Crash reporting](./instrumentation/crash/)
* [ANR detection](./instrumentation/anr/)
* Network change detection
* [Network change detection](./instrumentation/network/)
* Android [Activity lifecycle instrumentation](./instrumentation/activity/)
* Android Fragment lifecycle monitoring
* Access to the OpenTelemetry APIs for manual instrumentation
Expand Down
29 changes: 29 additions & 0 deletions instrumentation/network/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

# Network Change Instrumentation

Status: experimental

Android applications are typically deployed on mobile devices. These mobile devices
have the ability to move between networks, and sometimes a network change can
have an impact on application performance characteristics. This instrumentation
will generate telemetry when the network changes, as detected
via [ConnectivityManager.NetworkCallback](https://developer.android.com/reference/android/net/ConnectivityManager.NetworkCallback).

This instrumentation only generates telemetry when the application is in the foreground,
not when the application is backgrounded.

## Telemetry

This instrumentation produces the following telemetry:

### Network Change

* Type: Span
* Name: `network.change`
* Description: This zero-duration span is started and ended when a network change is detected.
* Attributes:
* `network.status`: One of `lost` or `available`.
* `network.connection.type` (semconv) one of `cell`, `wifi`, `wired`, `unavailable`, `unknown`, `vpn`.

Note: This instrumentation supports additional user-configurable `AttributeExtractors` that
may set additional attributes when given a `CurrentNetwork` instance.

0 comments on commit ae83d01

Please sign in to comment.