Skip to content

Commit f2192d9

Browse files
committed
add process name to application info
1 parent 8fe1383 commit f2192d9

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

firebase-perf/src/main/java/com/google/firebase/perf/transport/TransportManager.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@
5151
import com.google.firebase.perf.v1.PerfMetric;
5252
import com.google.firebase.perf.v1.PerfMetricOrBuilder;
5353
import com.google.firebase.perf.v1.TraceMetric;
54+
import com.google.firebase.sessions.ProcessDetailsProvider;
55+
5456
import java.lang.ref.WeakReference;
5557
import java.text.DecimalFormat;
5658
import java.util.Collections;
@@ -230,6 +232,8 @@ private void finishInitialization() {
230232
applicationInfoBuilder = ApplicationInfo.newBuilder();
231233
applicationInfoBuilder
232234
.setGoogleAppId(firebaseApp.getOptions().getApplicationId())
235+
.setProcessName(
236+
ProcessDetailsProvider.getProcessDetailsProvider().getCurrentProcessDetails(appContext).getProcessName())
233237
.setAndroidAppInfo(
234238
AndroidApplicationInfo.newBuilder()
235239
.setPackageName(packageName)

firebase-perf/src/main/proto/firebase/perf/v1/perf_metric.proto

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ message GaugeMetadata {
292292
// Additional metadata about an application and its state (including state of
293293
// the device at runtime) that is not provided by firebase data transport.
294294
//
295-
// Next tag: 8
295+
// Next tag: 9
296296
message ApplicationInfo {
297297
// Identifier for the application that has been registered with firebase.
298298
// Contains pantheon project number, platform and the hash of the (package
@@ -316,6 +316,9 @@ message ApplicationInfo {
316316

317317
// A map of global-level custom attribute names to values.
318318
map<string, string> custom_attributes = 6;
319+
320+
// The name of process that initiate the event. Currently only populated for Android apps.
321+
optional string process_name = 8;
319322
}
320323

321324
// Additional metadata about an android application that is not provided by

firebase-sessions/src/main/kotlin/com/google/firebase/sessions/ProcessDetailsProvider.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ import com.google.android.gms.common.util.ProcessUtils
2828
*
2929
* @hide
3030
*/
31-
internal object ProcessDetailsProvider {
31+
object ProcessDetailsProvider {
32+
@JvmStatic
33+
fun getProcessDetailsProvider(): ProcessDetailsProvider {
34+
return this
35+
}
3236
/** Gets the details for all of this app's running processes. */
3337
fun getAppProcessDetails(context: Context): List<ProcessDetails> {
3438
val appUid = context.applicationInfo.uid

firebase-sessions/src/main/kotlin/com/google/firebase/sessions/SessionEvent.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ internal data class DataCollectionStatus(
8181
)
8282

8383
/** Container for information about the process */
84-
internal data class ProcessDetails(
84+
data class ProcessDetails(
8585
val processName: String,
8686
val pid: Int,
8787
val importance: Int,

0 commit comments

Comments
 (0)