[TT-11125] Add trace_id to traffic logs #899
Closed
probelabs / Visor: performance
succeeded
Oct 2, 2025 in 4m 46s
✅ Check Passed (Warnings Found)
performance check passed. Found 1 warning, but fail_if condition was not met.
Details
📊 Summary
- Total Issues: 3
- Warning Issues: 1
🐛 Issues by Category
⚡ Performance (3)
⚠️ analytics/analytics.go:78 - The newTraceIDfield, mapped to thetraceiddatabase column, is a high-cardinality field that will likely be used for filtering. Queries against this column without an index will cause full table scans, leading to significant performance degradation on large datasets.- ℹ️ analytics/analytics.go:78 - The addition of the
TraceIDstring field to theAnalyticsRecordstruct increases its memory footprint. While the per-record increase is small, the cumulative effect can be significant in a high-throughput environment, leading to higher overall memory consumption for the application. - ℹ️ analytics/analytics_test.go:179 - The new test for
RemoveIgnoredFieldshighlights a pre-existing performance issue. This function uses reflection in a nested loop for every analytics record, which is inefficient and can cause CPU overhead on a hot path.
Generated by Visor - AI-powered code review
Annotations
Check warning on line 78 in analytics/analytics.go
probelabs / Visor: performance
performance Issue
The new `TraceID` field, mapped to the `traceid` database column, is a high-cardinality field that will likely be used for filtering. Queries against this column without an index will cause full table scans, leading to significant performance degradation on large datasets.
Raw output
Add a database index to the `traceid` column for all supported SQL databases. This should be noted in documentation and included in any database migration scripts.
Check notice on line 78 in analytics/analytics.go
probelabs / Visor: performance
performance Issue
The addition of the `TraceID` string field to the `AnalyticsRecord` struct increases its memory footprint. While the per-record increase is small, the cumulative effect can be significant in a high-throughput environment, leading to higher overall memory consumption for the application.
Raw output
This is an acceptable trade-off for the new functionality, but the impact on memory usage should be considered for capacity planning in high-volume deployments.
Check notice on line 185 in analytics/analytics_test.go
probelabs / Visor: performance
performance Issue
The new test for `RemoveIgnoredFields` highlights a pre-existing performance issue. This function uses reflection in a nested loop for every analytics record, which is inefficient and can cause CPU overhead on a hot path.
Raw output
Consider optimizing `RemoveIgnoredFields` by building a map of JSON tags to struct fields upon pump initialization. This would change the lookup from a slow O(N) iteration to a fast O(1) map lookup per field, reducing CPU usage for users of the field-ignoring feature.
Loading