cvkem / jaeger_stats

Parse Jaeger-json files in order to collect trace statistics
Apache License 2.0
1 stars 2 forks source link

trace_analysis: 'http.status_code' does not contain a number. Value = String("200") #3

Open jayvdb opened 2 months ago

jayvdb commented 2 months ago

We have traces created using tracing-actix-web, which have the following error when trace_analysis is used

> trace_analysis ./traces-uat-jun-1-4.json
Reading all traces from folder: ./traces-uat-jun-1-4.json
Reading a Jaeger-trace from './traces-uat-jun-1-4.json'
About to read trace via serde
thread 'main' panicked at src/raw/jaeger.rs:68:13:
The key 'http.status_code' does not contain a number. Value = String("200")

When I query the tag.type_id, I get both int64 and string, which doesnt surprise me as we have two providers of http trace data - the client and the actix-web middleware.

cvkem commented 2 months ago

Indeed the rust Serde-json (in the way I used it) is strict on types, so a field can not be sometimes a int64 and other times an int64. However, if both are needed I think serde allows an auto-conversion, however, I need to dive into it if that brings value to your use-case. I also noticed you found another way around it. So please let me know if it is useful to investigate this option.

jayvdb commented 2 months ago

I am happy with https://github.com/cvkem/jaeger_stats/pull/4 for the moment. Manually supporting both will get tedious if there are lots of tags being parsed that could be both, but I suspect most will be only valid in one data type.