Skip to content

[TT-11125] Add trace_id to traffic logs

8941d7f
Select commit
Loading
Failed to load commit list.
Closed

[TT-11125] Add trace_id to traffic logs #899

[TT-11125] Add trace_id to traffic logs
8941d7f
Select commit
Loading
Failed to load commit list.
probelabs / Visor: style succeeded Oct 2, 2025 in 4m 47s

✅ Check Passed

style check completed successfully with no issues found.

Details

📊 Summary

  • Total Issues: 2

🐛 Issues by Category

🎨 Style (2)

  • ℹ️ analytics/analytics.go:78 - The GORM column name traceid is inconsistent with the JSON tag trace_id and the Go field name TraceID. While not a functional issue, using a consistent naming convention like snake_case (trace_id) for database columns improves readability and aligns with common database practices.
  • ℹ️ analytics/analytics_test.go:185 - The test case for RemoveIgnoredFields uses the JSON field name trace_id to test its functionality. This works correctly but relies on the internal implementation detail of how RemoveIgnoredFields maps JSON tags to struct fields. The test would be more robust and clearer if it directly tested the behavior without this implicit dependency.

Generated by Visor - AI-powered code review

Annotations

Check notice on line 78 in analytics/analytics.go

See this annotation in the file changed.

@probelabs probelabs / Visor: style

style Issue

The GORM column name `traceid` is inconsistent with the JSON tag `trace_id` and the Go field name `TraceID`. While not a functional issue, using a consistent naming convention like snake_case (`trace_id`) for database columns improves readability and aligns with common database practices.
Raw output
For consistency with the JSON tag and common database naming conventions, change the GORM column tag from `column:traceid` to `column:trace_id`.

Check notice on line 185 in analytics/analytics_test.go

See this annotation in the file changed.

@probelabs probelabs / Visor: style

style Issue

The test case for `RemoveIgnoredFields` uses the JSON field name `trace_id` to test its functionality. This works correctly but relies on the internal implementation detail of how `RemoveIgnoredFields` maps JSON tags to struct fields. The test would be more robust and clearer if it directly tested the behavior without this implicit dependency.
Raw output
While the test is functionally correct, consider adding a comment to clarify that `RemoveIgnoredFields` operates on JSON tags, explaining why `"trace_id"` is used instead of the Go field name `"TraceID"`. This improves maintainability for future developers.