Skip to content

Commit

Permalink
Add ANR docs (#787)
Browse files Browse the repository at this point in the history
* order alphabeticaly

* add docs for anr

* spotless
  • Loading branch information
breedx-splk authored Jan 31, 2025
1 parent 5b3d4ea commit 33fa4a5
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 4 deletions.
8 changes: 4 additions & 4 deletions android-agent/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ dependencies {

// Default instrumentations:
api(project(":instrumentation:activity"))
api(project(":instrumentation:fragment"))
api(project(":instrumentation:crash"))
api(project(":instrumentation:startup"))
api(project(":instrumentation:slowrendering"))
api(project(":instrumentation:anr"))
api(project(":instrumentation:crash"))
api(project(":instrumentation:fragment"))
api(project(":instrumentation:network"))
api(project(":instrumentation:slowrendering"))
api(project(":instrumentation:startup"))
}

extra["pomName"] = "OpenTelemetry Android Agent"
Expand Down
30 changes: 30 additions & 0 deletions instrumentation/anr/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

# ANR (Application Not Responding) Instrumentation

Status: experimental

The ANR (Application Not Responding) instrumentation helps to detect
when an application becomes unresponsive. This instrumentation functions
by polling the UI thread once every second, verifying that the main UI
thread is still active. If 5 consecutive checks fail, then an ANR condition
has occurred, and telemetry will be generated.

The ANR instrumentation is only active when the application is in the
foreground.

## Telemetry

This instrumentation produces the following telemetry:

### ANR

* Type: Span
* Name: `ANR`
* Description: This zero-duration span is created when this instrumentation detects an ANR.
* Status: `ERROR` (always)
* Attributes:
* `exception.stacktrace`: A string representation of the call stack of the main thread at the time of the ANR.
([see semconv here](https://github.com/open-telemetry/semantic-conventions/blob/0b3babde7ff9f74b03a1a49adcdb319354d47d85/docs/attributes-registry/exception.md#exception-stacktrace))

Note: This instrumentation supports additional user-configurable `AttributeExtractors` that
may set additional attributes from the given `StackTraceElement[]`.

0 comments on commit 33fa4a5

Please sign in to comment.