{"id":15177402,"url":"https://github.com/open-telemetry/opentelemetry-android","last_synced_at":"2026-01-23T19:07:01.524Z","repository":{"id":182868359,"uuid":"669220109","full_name":"open-telemetry/opentelemetry-android","owner":"open-telemetry","description":"OpenTelemetry Tooling for Android","archived":false,"fork":false,"pushed_at":"2025-05-14T04:22:12.000Z","size":4984,"stargazers_count":203,"open_issues_count":88,"forks_count":64,"subscribers_count":26,"default_branch":"main","last_synced_at":"2025-05-15T00:11:56.332Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/open-telemetry.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"code-of-conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-07-21T16:31:27.000Z","updated_at":"2025-05-14T04:20:57.000Z","dependencies_parsed_at":"2023-10-16T18:56:43.757Z","dependency_job_id":"6957b416-dc8f-4c81-97c0-5ddb6fdf1493","html_url":"https://github.com/open-telemetry/opentelemetry-android","commit_stats":{"total_commits":1125,"total_committers":31,"mean_commits":36.29032258064516,"dds":0.7928888888888889,"last_synced_commit":"f93a722f4d642b553d68d04dd642f361b800eb29"},"previous_names":["open-telemetry/opentelemetry-android"],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-telemetry%2Fopentelemetry-android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-telemetry%2Fopentelemetry-android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-telemetry%2Fopentelemetry-android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-telemetry%2Fopentelemetry-android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/open-telemetry","download_url":"https://codeload.github.com/open-telemetry/opentelemetry-android/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254535829,"owners_count":22087399,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-27T14:21:59.192Z","updated_at":"2026-01-23T19:07:01.516Z","avatar_url":"https://github.com/open-telemetry.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003cimg src=\"https://opentelemetry.io/img/logos/opentelemetry-logo-nav.png\" alt=\"OpenTelemetry Icon\" width=\"45\" height=\"\"\u003e OpenTelemetry Android\n\n[![Continuous Build][ci-image]][ci-url]\n[![Maven Central][maven-image]][maven-url]\n[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/open-telemetry/opentelemetry-android/badge)](https://scorecard.dev/viewer/?uri=github.com/open-telemetry/opentelemetry-android)\n[![android api](https://img.shields.io/badge/Android_API-21-green.svg \"Android min API 21\")](VERSIONING.md)\n\n* [About](#about)\n* [Getting Started](#getting-started)\n* [Features](#features)\n* [Contributing](#contributing)\n\n# About\n\nThe repository contains the `OpenTelemetry Android Agent`, which initializes the [OpenTelemetry Java SDK](https://github.com/open-telemetry/opentelemetry-java) and provides\nauto-instrumentation of Android apps for real user monitoring (RUM).\n\nWhile this project isn't 100% Kotlin, it has a \"Kotlin-First\" policy where usage in Kotlin-based Android apps will be prioritized in terms\nof API and idioms. More details about this policy can be found [here](./docs/KOTLIN_FIRST.md).\n\n\u003e [!IMPORTANT]\n\u003e We are currently seeking additional contributors! See [Contributing](#contributing) for details.\n\n# Getting Started\n\n\u003e If your project's minSdk is lower than 26, then you must enable\n\u003e [corelib desugaring](https://developer.android.com/studio/write/java8-support#library-desugaring).\n\u003e See [#73](https://github.com/open-telemetry/opentelemetry-android/issues/73) for more information.\n\u003e Further, you must use AGP 8.3.0+ and set the `android.useFullClasspathForDexingTransform`\n\u003e property in `gradle.properties` to `true` to ensure desugaring runs properly. For the full\n\u003e context for this workaround, please see\n\u003e [this issue](https://issuetracker.google.com/issues/230454566#comment18).\n\n## Gradle Setup\n\nTo use the Android Agent in your application, you will first need to add\na dependency in your application's `build.gradle.kts`. We publish a bill of materials (BOM) that\nhelps to coordinate versions of the this project's components and the upstream\n`opentelemetry-java-instrumentation` and `opentelemetry-java` dependencies. We recommend\nusing the BOM as a platform dependency, and then omitting explicit version information\nfrom all other opentelemetry dependencies:\n\n```kotlin\ndependencies {\n    //...\n    api(platform(\"io.opentelemetry.android:opentelemetry-android-bom:1.1.0-alpha\"))\n    implementation(\"io.opentelemetry.android:android-agent\") // Version is resolved through the BOM\n    //...\n}\n```\n\n## Agent Initialization\n\nTo initialize the Agent, call `OpenTelemetryRumInitializer.initialize()` in the `onCreate()` function in your app's `Application` object, ideally as early as possible after calling `super.onCreate()`.\n\n```kotlin\nclass MainApplication: Application() {\n    var otelRum: OpenTelemetryRum? = null\n    \n    override fun onCreate() {\n        super.onCreate()\n        otelRum = initOTel(this)\n    }\n}\n\nprivate fun initOTel(context: Context): OpenTelemetryRum? =\n    runCatching {\n        OpenTelemetryRumInitializer.initialize(\n            context = context,\n            configuration = {\n                httpExport {\n                    baseUrl = \"http://10.0.2.2:4318\"\n                    baseHeaders = mapOf(\"foo\" to \"bar\")\n                }\n                instrumentations {\n                    activity {\n                        enabled(true)\n                    }\n                    fragment {\n                        enabled(false)\n                    }\n                }\n                session {\n                    backgroundInactivityTimeout = 5.minutes\n                    maxLifetime = 1.days\n                }\n                globalAttributes {\n                    Attributes.of(stringKey(\"demo-version\"), \"test\")\n                }\n            }\n        )\n    }.onFailure {\n        Log.e(\"OpenTelemetryRumInitializer\", \"Initialization failed\", it)\n    }.getOrNull()\n```\n\nThis call will return an `OpenTelemetryRum` instance with which you can use the Agent and OTel APIs.\n\n# Features\n\nIn addition to exposing the OTel Java API for manual instrumentation, agent also offers the following features:\n\n* Streamlined initialization and configuration of the Java SDK instance\n* Installation and management of bundled instrumentation\n* Offline buffering of telemetry via disk persistence\n* Redact and change span attributes before export\n\n## Instrumentation\n\nThe following instrumentation modules are bundled with the Android Agent:\n\n* [Activity lifecycle](./instrumentation/activity/)\n* [ANR detection](./instrumentation/anr/)\n* [Crash reporting](./instrumentation/crash/)\n* [Fragment lifecycle](./instrumentation/fragment)\n* [Network change detection](./instrumentation/network/)\n* [Slow/frozen frame render detection](./instrumentation/slowrendering)\n* [Startup](./instrumentation/startup)\n* [Sessions](./instrumentation/sessions)\n* [Screen orientation](./instrumentation/screen-orientation)\n* [View click](./instrumentation/view-click/)\n\nThere are also other\n[additional instrumentation modules](https://github.com/open-telemetry/opentelemetry-android/tree/main/instrumentation)\nthat application developers can include through a gradle dependency. \nInstrumentations are detected at runtime via the classpath, and\nare installed automatically.\n\n## Additional Documentation\n\nSee the following pages for details about the related topics:\n\n- [Kotlin-First Policy](./docs/KOTLIN_FIRST.md)\n- [StrictMode Guidance](./docs/STRICTMODE.md)\n- [Exporter Management](./docs/EXPORTER_CHAIN.md)\n\n# Contributing\n\nWe are currently resource constrained and are actively seeking new contributors interested in working towards [approver](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#approver) / [maintainer](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#maintainer) roles.\nIn addition to the documentation for approver / maintainer roles and the [contributing](./CONTRIBUTING.md) guide, here are some additional notes on engaging:\n\n- [Pull request](https://github.com/open-telemetry/opentelemetry-android/pulls) reviews are equally or more helpful than code contributions. Comments and approvals are valuable with or without a formal project role. They're also a great forcing function to explore a fairly complex codebase.\n- Attending the [Android: SDK + Automatic Instrumentation](https://github.com/open-telemetry/community?tab=readme-ov-file#implementation-sigs) Special Interest Group (SIG) is a great way to get to know community members and learn about project priorities.\n- Issues labeled [help wanted](https://github.com/open-telemetry/opentelemetry-android/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) are project priorities. Code contributions (or pull request reviews when a PR is linked) for these issues are particularly important.\n- Triaging / responding to new issues and discussions is a great way to engage with the project.\n- We are available in the [#otel-android](https://cloud-native.slack.com/archives/C05J0T9K27Q) channel in the [CNCF Slack](https://slack.cncf.io/). Please join us there for further discussions.\n\n### Thanks to all of our contributors!\n\n\u003ca href=\"https://github.com/open-telemetry/opentelemetry-android/graphs/contributors\"\u003e\n  \u003cimg alt=\"Repo contributors\" src=\"https://contrib.rocks/image?repo=open-telemetry/opentelemetry-android\" /\u003e\n\u003c/a\u003e\n\n## Maintainers\n\n- [Cesar Munoz](https://github.com/likethesalad), Elastic\n- [Jason Plumb](https://github.com/breedx-splk), Splunk\n\nFor more information about the maintainer role, see the [community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#maintainer).\n\n## Approvers\n\n- [Hanson Ho](https://github.com/bidetofevil), Embrace\n- [Jamie Lynch](https://github.com/fractalwrench), Embrace\n- [Manoel Aranda Neto](https://github.com/marandaneto), PostHog\n\nFor more information about the Approver role, see the [community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#approver).\n\n[ci-image]: https://github.com/open-telemetry/opentelemetry-android/actions/workflows/build.yaml/badge.svg\n\n[ci-url]: https://github.com/open-telemetry/opentelemetry-android/actions?query=workflow%3Abuild+branch%3Amain\n\n[maven-image]: https://img.shields.io/maven-central/v/io.opentelemetry.android/android-agent.svg\n\n[maven-url]: https://central.sonatype.com/artifact/io.opentelemetry.android/android-agent\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-telemetry%2Fopentelemetry-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopen-telemetry%2Fopentelemetry-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-telemetry%2Fopentelemetry-android/lists"}