With Performance Monitoring, you can use attributes to segment performance data and focus on your app's performance in different real-world scenarios.
From the On Device or Network tab, you can click through various screens to explore a trace and
drill down into metrics of interest. On most pages, you can use the
- Filter by App version to view data about a past release or your latest release
- Filter by Device to learn how older devices handle your app
- Filter by Country to make sure your database location isn't affecting a specific region
For even more powerful analysis based on attributes, export your performance data to BigQuery.
Performance Monitoring automatically collects a variety of default attributes depending on the type of trace.
In addition to these default attributes, you can also create custom attributes on your custom code traces to segment data by categories specific to your app. For example, in a game, you can segment data by game level.
Default attributes for iOS and Android apps
All traces for iOS and Android apps collect the following attributes by default:
- App version
- OS level
In addition, network request traces also collect the following attribute:
- MIME type
Collecting user data
Create custom attributes
You can create custom attributes on any of your instrumented custom code traces.
To use custom attributes, add code to your app that defines the attribute and associates it with a specific custom code trace. You can set the custom attribute anytime between when the trace starts and when the trace stops.
Note the following:
Names for custom attributes must meet the following requirements: no leading or trailing whitespace, no leading underscore (
_) character, and max length is 32 characters.
Each custom code trace can record up to 5 custom attributes.
You shouldn't use custom attributes that contain information that personally identifies an individual to Google.
Learn more about this guideline
let trace = Performance.startTrace(name: "CUSTOM_TRACE_NAME") trace.setValue("A", forAttribute: "experiment") // Update scenario. trace.setValue("B", forAttribute: "experiment") // Reading scenario. let experimentValue:String? = trace.valueForAttribute("experiment") // Delete scenario. trace.removeAttribute("experiment") // Read attributes. let attributes:[String, String] = trace.attributes;
FIRTrace *trace = [FIRPerformance startTraceWithName:@"CUSTOM_TRACE_NAME"]; [trace setValue:@"A" forAttribute:@"experiment"]; // Update scenario. [trace setValue:@"B" forAttribute:@"experiment"]; // Reading scenario. NSString *experimentValue = [trace valueForAttribute:@"experiment"]; // Delete scenario. [trace removeAttribute:@"experiment"]; // Read attributes. NSDictionary <NSString *, NSString *> *attributes = [trace attributes];