question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Metrics in scientific notation are not correctly parsed by default

See original GitHub issue

/kind bug

This is an excerpt of a Log of one Trial: As you can see the Score is still correct in file-metricscollector.go:49 but is then wrongly parsed somewhere:

I1007 08:08:59.928474      73 main.go:136] Score=-7.539458549707136e-05

7.10.2021 10:09:01 W1007 08:09:01.339500      73 file-metricscollector.go:49] Metrics will not have timestamp since Score=-7.539458549707136e-05 doesn't begin with timestamp string

7.10.2021 10:09:01 I1007 08:09:01.348925      73 main.go:397] Metrics reported. :

7.10.2021 10:09:01 metric_logs:<time_stamp:"0001-01-01T00:00:00Z" metric:<name:"Score" value:"-7.539458549707136" > >

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
anencore94commented, Oct 8, 2021

Thanks for you comment 😃 I think we should take this ([\w|-]+)\s*=\s*([+-]?\d(\.\d+)?([Ee][+-]?\d+)?)

to cover this case :Score=1.23E99 and Score=+1.23E-99

0reactions
fabianvdWcommented, Oct 8, 2021

Perhaps it would make sense to correctly parse scientifc notation with the default regexp pattern though?

I think so too. I’ll take this issue

([\w|-]+)\s*=\s*((-?\d+)(\.\d+)?(e(-|\+)?\d+)?) should work

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues with scientific notation metric values (and ... - GitHub
Issues with scientific notation metric values (and metrics that are too large) ... Metrics will not have timestamp since error parsing time ...
Read more >
Suppress expansion of exponential notation in parse_expr ...
When I input, e.g. 1e10 m/s^2 , it uses sympy parse_expr to parse it as 1e10*m/s**2 so that python can evaluate it. However,...
Read more >
Parsing - Datadog Docs
Datadog automatically parses JSON-formatted logs. ... Matches a floating point number (with scientific notation support) and parses it as a string.
Read more >
Rust Float Parsing is Atypically Slow - Reddit
You say it yourself: Rust tries to get everything correct. Correctness in this case is parsing the specific float represented by the string....
Read more >
Filter and pattern syntax - Amazon CloudWatch Logs
Match terms and extract values in log events using metric filters and filter patterns in CloudWatch Logs.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found