Commit eab025f
fix: always log metadata for free tier exceeded, skip only S3 bodies (#5545)
* fix: PTB should read bodies from S3 even when freeLimitExceeded
PTB requests always store bodies to S3 for billing purposes, so Jawn
should not treat them as "not_stored_exceeded_free". Only non-PTB
requests with freeLimitExceeded should skip S3 body reading.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat: always log metadata to ClickHouse, skip only S3 bodies for exceeded free tier
- Remove early exit that skipped Kafka logging entirely
- Metadata (request count, latency, tokens, cost) always logged to ClickHouse
- Only S3 body storage is skipped for non-PTB exceeded free tier
- This allows tracking request volume for exceeded orgs
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: PTB with free tier exceeded skips S3 only if usage extraction succeeded
- PTB + got usage: skip S3 bodies (we have what we need for billing)
- PTB + failed to get usage: store S3 bodies (Jawn needs to extract)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* chore: fix outdated comment about early exit
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Justin Torre <justin@Justins-MacBook-Pro.local>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>1 parent 4420800 commit eab025f
File tree
2 files changed
+18
-16
lines changed- valhalla/jawn/src/lib/handlers
- worker/src/lib/dbLogger
2 files changed
+18
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
175 | | - | |
| 175 | + | |
176 | 176 | | |
177 | 177 | | |
178 | | - | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
179 | 181 | | |
180 | 182 | | |
181 | 183 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
797 | 797 | | |
798 | 798 | | |
799 | 799 | | |
800 | | - | |
801 | | - | |
802 | | - | |
803 | | - | |
804 | | - | |
805 | | - | |
806 | | - | |
807 | | - | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
808 | 803 | | |
809 | 804 | | |
810 | 805 | | |
| |||
840 | 835 | | |
841 | 836 | | |
842 | 837 | | |
843 | | - | |
844 | | - | |
845 | | - | |
846 | | - | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
847 | 847 | | |
848 | 848 | | |
849 | 849 | | |
| 850 | + | |
850 | 851 | | |
851 | 852 | | |
852 | 853 | | |
| |||
952 | 953 | | |
953 | 954 | | |
954 | 955 | | |
955 | | - | |
956 | | - | |
| 956 | + | |
957 | 957 | | |
958 | 958 | | |
959 | 959 | | |
| |||
0 commit comments