Skip to content

Commit fdfd2f6

Browse files
authored
Fix Android profile chunk envelope type (#4366)
* fixed profile_chunk envelope type, while keeping the profile_chunk_ui rate limit key
1 parent 6b86bb7 commit fdfd2f6

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
### Fixes
6+
7+
- Fix Android profile chunk envelope type for UI Profiling ([#4366](https://github.com/getsentry/sentry-java/pull/4366))
8+
39
## 8.11.0
410

511
### Features

sentry/src/main/java/io/sentry/SentryItemType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public enum SentryItemType implements JsonSerializable {
1515
Attachment("attachment"),
1616
Transaction("transaction"),
1717
Profile("profile"),
18-
ProfileChunk("profile_chunk_ui"),
18+
ProfileChunk("profile_chunk"),
1919
ClientReport("client_report"),
2020
ReplayEvent("replay_event"),
2121
ReplayRecording("replay_recording"),

sentry/src/main/java/io/sentry/transport/RateLimiter.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,10 @@ private boolean isRetryAfter(final @NotNull String itemType) {
191191
return DataCategory.Attachment;
192192
case "profile":
193193
return DataCategory.Profile;
194-
case "profile_chunk_ui":
194+
// When we send a profile chunk, we have to check for profile_chunk_ui rate limiting,
195+
// because that's what relay returns to rate limit Android. When (if) we will implement JVM
196+
// profiling we will have to check both rate limits.
197+
case "profile_chunk":
195198
return DataCategory.ProfileChunkUi;
196199
case "transaction":
197200
return DataCategory.Transaction;

sentry/src/test/java/io/sentry/protocol/SentryItemTypeSerializationTest.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class SentryItemTypeSerializationTest {
2525
assertEquals(serialize(SentryItemType.Attachment), json("attachment"))
2626
assertEquals(serialize(SentryItemType.Transaction), json("transaction"))
2727
assertEquals(serialize(SentryItemType.Profile), json("profile"))
28+
assertEquals(serialize(SentryItemType.ProfileChunk), json("profile_chunk"))
2829
assertEquals(serialize(SentryItemType.ClientReport), json("client_report"))
2930
assertEquals(serialize(SentryItemType.ReplayEvent), json("replay_event"))
3031
assertEquals(serialize(SentryItemType.ReplayRecording), json("replay_recording"))
@@ -41,6 +42,7 @@ class SentryItemTypeSerializationTest {
4142
assertEquals(deserialize(json("attachment")), SentryItemType.Attachment)
4243
assertEquals(deserialize(json("transaction")), SentryItemType.Transaction)
4344
assertEquals(deserialize(json("profile")), SentryItemType.Profile)
45+
assertEquals(deserialize(json("profile_chunk")), SentryItemType.ProfileChunk)
4446
assertEquals(deserialize(json("client_report")), SentryItemType.ClientReport)
4547
assertEquals(deserialize(json("replay_event")), SentryItemType.ReplayEvent)
4648
assertEquals(deserialize(json("replay_recording")), SentryItemType.ReplayRecording)

0 commit comments

Comments
 (0)