Skip to content

Integrate Android PANS Metrics with OpenTelemetry #845

Open
@cforce

Description

@cforce

Android's Per-Application Network Selection (PANS) feature enables routing app-specific traffic through OEM-paid networks, allowing better control over data costs and connectivity management. To improve observability, we need to consume PANS metrics and send them as OpenTelemetry metrics for further analysis.

  • Implement a service to collect PANS-related metrics from system services (e.g., netstats dumpsys, connectivity dumpsys).
  • Extract key metrics, including:
    • Per-app network usage (Data transmitted via OEM_PAID and OEM_PRIVATE networks)
    • App-to-network mappings (Which apps are using which OEM networks)
    • Network preference changes (Updates to setOemNetworkPreference)
    • Connectivity issues or errors
  • Convert these metrics into OpenTelemetry format with appropriate labels such as:
    • app_package_name
    • network_type (OEM_PAID, OEM_PRIVATE)
    • data_transmitted_bytes
    • timestamp
  • Use OpenTelemetry SDK to send metrics to the configured backend .
  • Ensure proper error handling and logging for debugging connectivity issues.

Considerations

  • Utilize Android netstats dumpsys for collecting network usage metrics per application.
  • Implement an Android Service that periodically fetches metrics and pushes them to OpenTelemetry.
  • Use the OpenTelemetry Android SDK for sending telemetry data.
  • Ensure compatibility with Android Automotive OS and PANS APIs.
  • Provide persistence across reboots to reapply network preferences.
  • Optimize for battery efficiency and minimize resource usage.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions