In addition to these default attributes, you can also create custom attributes
on your custom traces to segment data by
categories specific to your app. For example, in a game, you can segment data by
game level.

Collecting user data

Collecting user data: Performance Monitoring does not itself collect
any personally identifiable information (PII), such as names, email
addresses, or phone numbers. Developers can collect additional data using
Performance Monitoring by attaching custom attributes. Such data collected through
Performance Monitoring should not contain information that personally identifies an
individual to Google.

Here's an example of a log message that does not contain
personally identifiable information:

trace.putAttribute("experiment", "A");

Here's an example that does contain personally
identifiable information (do not use this type of
custom attribute in your app):

trace.putAttribute("email", user.getEmailAddress());

Data that exposes any personally identifiable information is subject to
deletion without notice.

Create custom attributes

You can use custom attributes on specific traces. You can then use custom
attributes as filters for your performance data in the Firebase console.

To use custom attributes, add code to your app defining the attribute and
applying it to a specific trace. You can set the custom attribute anytime
between when the trace starts and when the trace stops.

Note the following:

You're limited to 5 custom attributes per trace.

Names for custom attributes must meet the following requirements: no
leading or trailing whitespace, no leading underscore (_) character, and max
length is 32 characters.