-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add typed properties for analytics events #823
Conversation
This is a work in progress, it breaks One Collector and tests.
sdk/appcenter-analytics/src/main/java/com/microsoft/appcenter/analytics/Analytics.java
Outdated
Show resolved
Hide resolved
…' into feature/event-typed-properties-app
* <ul> | ||
* <li>The event name needs to match the [a-zA-Z0-9]((\.(?!(\.|$)))|[_a-zA-Z0-9]){3,99} regular expression.</li> | ||
* <li>The baseData and baseDataType properties are reserved and thus discarded.</li> | ||
* <li>The full event size when encoded in JSON cannot be larger than 1.9MB.</li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The full event size when encoded in JSON to JSON string cannot be larger than 1.9MB.
* For OneCollector: | ||
* <ul> | ||
* <li>The event name needs to match the [a-zA-Z0-9]((\.(?!(\.|$)))|[_a-zA-Z0-9]){3,99} regular expression.</li> | ||
* <li>The baseData and baseDataType properties are reserved and thus discarded.</li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use "baseData" and "baseDataType"? We need to wrap reserved keyword in quotes.
...ectDependency/java/com/microsoft/appcenter/sasquatch/activities/EventPropertiesActivity.java
Show resolved
Hide resolved
if (!super.equals(o)) { | ||
return false; | ||
} | ||
if (this == o) return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really don't like one-line IF
statements. I know it's just the equals method but this makes my skin crawl in a bad way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is generated code ;)
For equals/haschode, we just use the IDE to generate or regenerate when we add or remove a field.
if (key.length() > MAX_PROPERTY_ITEM_LENGTH) { | ||
message = String.format("Typed property '%s' : property key length cannot be longer than %s characters. Property key will be truncated.", key, MAX_PROPERTY_ITEM_LENGTH); | ||
AppCenterLog.warn(LOG_TAG, message); | ||
property.setName(key.substring(0, MAX_PROPERTY_ITEM_LENGTH)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should change a copy of the property, not the property itself. Even though they are moved to another array, that array contains references to properties that will be used in other logs as well. (same comment on line 189)
…rrent-exception Avoid concurrent modification exception when doing property traversal
* <p> | ||
* Additional validation rules apply depending on the configured secret. | ||
* <p> | ||
* For AppCenter: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: AppCenter
-> App Center
. (Same with OneCollector
-> One Collector
)
* <p> | ||
* For AppCenter: | ||
* <ul> | ||
* <li>the event name cannot be longer than 256 and is truncated otherwise.</li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: these list items should be capitalized (like the ones for OC)
* <p> | ||
* For AppCenter: | ||
* <ul> | ||
* <li>the event name cannot be longer than 256 and is truncated otherwise.</li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Capitalization
* <p> | ||
* Additional validation rules apply depending on the configured secret. | ||
* <p> | ||
* For AppCenter: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
App Center
* <li>the number of properties per event is limited to 20 (truncated).</li> | ||
* </ul> | ||
* <p> | ||
* For OneCollector: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One Collector
* <p> | ||
* Additional validation rules apply depending on the configured secret. | ||
* <p> | ||
* For AppCenter, the name cannot be longer than 256 and is truncated otherwise. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
App Center
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nit picks
Ingestion changes are in prod. |
Feature needs ingestion to be deployed to prod before merge.