[FR] Support sending Firebase Performance traces to multiple destinations (e.g. log, Firebase, Hotdog, Sentry, etc.)

Aperta
#1,954 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
30/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
android, firebase, kotlin

Direzione di ricerca

La issue menziona le utilità di monitoraggio delle prestazioni di Now in Android, ma non indica file o test. Inizia individuando queste utilità e verificando come vengono attualmente segnalate le tracce di Firebase Performance; il lavoro è completo quando un design chiaramente configurabile può inoltrare le tracce a più destinazioni, con una copertura del comportamento di reporting supportato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement
Is there an existing issue for this?
  • I have searched the existing issues
Describe the problem
Description

It would be extremely helpful if the Now in Android sample app (and its performance tracking utilities) could support sending performance trace data not only to Firebase Performance Monitoring but also to other destinations such as:

  • Logcat (for quick local debugging)
  • Firebase Performance Dashboard (default destination)
  • Hotdog
  • Sentry
  • (Any other custom tools)
Motivation

Developers often need performance data in multiple contexts simultaneously. For instance:

  • Logcat: Useful for immediate debugging during development, CI builds, or local testing.
  • Firebase: Great for aggregate analytics and real user monitoring.
  • Hotdog / Sentry / etc.: Useful for centralized error/performance dashboards, custom dashboards, or alternative monitoring solutions.

Serving multiple destinations would make debugging and monitoring smoother and more flexible.

Proposed approach
  • Create an abstraction layer over performance trace reporting, e.g., a PerformanceReporter interface.
  • Implement multiple reporters (e.g., LogcatReporter, FirebaseReporter, HotdogReporter, SentryReporter).
  • Make these reporters configurable (via dependency injection or a simple registry), so users can opt in to any combination they need.
Example usage
val performanceReporters = listOf(LogcatReporter(), FirebaseReporter(), SentryReporter())
PerformanceReporting.initialize(performanceReporters)

trace("user_login") {
    // Business logic here
}


### Describe the solution

interface PerformanceReporter {
    fun onTraceStart(name: String)
    fun onTraceEnd(name: String, durationMs: Long)
}
Each destination will implement this interface, for example:

kotlin
Copy code
class FirebaseReporter : PerformanceReporter { /* ... */ }
class LogcatReporter : PerformanceReporter { /* ... */ }
class SentryReporter : PerformanceReporter { /* ... */ }
class HotdogReporter : PerformanceReporter { /* ... */ }
2. Create a CompositePerformanceReporter
This class will manage a list of reporters and forward trace events to all of them:

kotlin
Copy code
class CompositePerformanceReporter(
    private val reporters: List<PerformanceReporter>
) : PerformanceReporter {
    override fun onTraceStart(name: String) {
        reporters.forEach { it.onTraceStart(name) }
    }

    override fun onTraceEnd(name: String, durationMs: Long) {
        reporters.forEach { it.onTraceEnd(name, durationMs) }
    }
}

### Additional context

_No response_

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct
Lingua principale
Kotlin
Stelle
22.1k
Fork
4.7k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di android/nowinandroid

Tutte le issue di android/nowinandroid

Issue simili

Altre issue su Kotlin

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.