firebase / firebase/firebase-ios-sdk
Firebase Performance doesn't accept spaces inside attribute names
- Dominant language
- C++
- Stars
- 6.7k
- Forks
- 1.8k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 75
Description
### Description
According to the [Firebase Performance documentation](https://firebase.google.com/docs/perf-mon/custom-code-traces?platform=ios#create-custom-attributes), these are the requirements for the name of the custom attributes:
> Names for custom attributes must meet the following requirements: no leading or trailing whitespace, no leading underscore (_) character, and max length is 32 characters.
Trying to set an attribute with a space in its name (like `my attribute`) fails with these log messages:
```
[FirebasePerformance][I-PRF500004] Illegal characters used for attribute name, characters allowed are alphanumeric or underscore.
[FirebasePerformance][I-PRF500001] Failed to initialize because of a nil or zero length attribute name.
```
[The code](https://github.com/firebase/firebase-ios-sdk/blob/bdac2b87f6d6e604deae914a970a75136b3a62b5/FirebasePerformance/Sources/FPRDataUtils.m#L54) doesn't match the documentation:
- it _only_ allows alphanumeric characters and underscores
- it allows underscores at the beginning of the name
Ideally I would like to be able to use spaces inside attribute names (as the documentation implies), since those names are user-visible in the dashboard and it would make them much more readable by non-technical people
### Reproducing the issue
_No response_
### Firebase SDK Version
9.4.0
### Xcode Version
13.4.1
### Installation Method
CocoaPods
### Firebase Product(s)
Performance
### Targeted Platforms
iOS
### Relevant Log Output
_No response_
### If using Swift Package Manager, the project's Package.resolved
_No response_
### If using CocoaPods, the project's Podfile.lock
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.