Commit a001e25
fix(kafka): [Queue Instrumentation 31] Write enqueued-time header as plain decimal
The sentry-task-enqueued-time Kafka header was serialized via
String.valueOf(double), which emits scientific notation (e.g.
1.776933649613E9) for epoch-seconds values. Cross-SDK consumers
(sentry-python, -ruby, -php, -dotnet) expect a plain decimal like
1776938295.692000 and could not parse the Java output, defeating the
cross-SDK alignment goal of #5283.
Route the value through DateUtils.doubleToBigDecimal(...).toString(),
the same helper already used to serialize epoch-seconds timestamps in
SentryTransaction, SentrySpan, SentryLogEvent, etc. At the pinned scale
of 6, BigDecimal.toString() produces plain decimal form for all
realistic epoch-seconds magnitudes.
Add regression assertions that reject scientific notation and pin the
plain-decimal format in SentryKafkaProducerInterceptorTest.
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 7384727 commit a001e25
2 files changed
Lines changed: 16 additions & 2 deletions
File tree
- sentry-kafka/src
- main/java/io/sentry/kafka
- test/kotlin/io/sentry/kafka
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
| 132 | + | |
132 | 133 | | |
133 | 134 | | |
134 | 135 | | |
| |||
Lines changed: 14 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
84 | 85 | | |
85 | 86 | | |
86 | 87 | | |
87 | | - | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
88 | 101 | | |
89 | 102 | | |
90 | 103 | | |
| |||
0 commit comments