-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix issue when response contains ANSI escape sequences #38
Conversation
@dmitryk-dk do I understand it right that #24 is fixed on the vmlogs backend side and no changes in the plugin are required? |
Yeah, I discussed the problem with @valyala, and he said that the main problem is on the Victorialogs side. But this PR helps to handle both situations with ANSI escape sequences and Unicode chars in the strings. |
There is a parsing issue with ANSI escape sequences, which a standard JSON decoder can't handle.
I used valyala fastjson library to solve this issue. Victoria logs can handle logs like
{"_time":"2024-06-26T13:15:15.000Z","_stream_id":"00000000000000009eaf29866f70976a098adc735393deb1","_stream":"{compose_project=\"app\",compose_service=\"gateway\"}","_msg":"\x1b[2m2024-06-26T13:15:15.004Z\x1b[0;39m \x1b[32mTRACE\x1b[0;39m \x1b[35m1\x1b[0;39m \x1b[2m---\x1b[0;39m \x1b[2m[ parallel-19]\x1b[0;39m \x1b[36mo.s.c.g.f.WeightCalculatorWebFilter \x1b[0;39m \x1b[2m:\x1b[0;39m Weights attr: {} ","compose_project":"app","compose_service":"gateway"}
where
\x1b[0;39m
can be present.Related issue: #24