Closed pmcollins closed 2 months ago
Since the protobuf field is sfixed64
, possibly the exporter should handle this case eagerly or somehow convert it to be in the correct range.
However, the metric process.runtime.cpython.context_switches
is coming from here and that seems like an impossibly large number of context switches. Maybe this is a bug in psutil for MacOS?
@pmcollins any way you can check the output of psutil.Process(os.getpid()).num_ctx_switches()
when this happens and see if it an SDK issue or psutil issue?
Just running it at the python console from my Intel Mac I get
>>> psutil.Process(os.getpid()).num_ctx_switches()
pctxsw(voluntary=3168756596733903550, involuntary=0)
So maybe a psutil issue (?), but also maybe an issue in the SDK with how we handle too big of numbers.
Ya that seems unexpected on the psutil side. For reference, on my ARM Mac:
$ python3 -c 'import psutil; import os; print(psutil.Process(os.getpid()).num_ctx_switches())'
pctxsw(voluntary=33, involuntary=0)
Same here ARM Mac
python3 -c 'import psutil; import os; print(psutil.Process(os.getpid()).num_ctx_switches())'
pctxsw(voluntary=26, involuntary=0)
I'd like to work on improving the logging for this scenario. I've removed the bug label because I'm not sure it is one.
@pmcollins
Would you like to be assigned to the issue?
Describe your environment
OS: Intel Mac Python version: 3.8 SDK version: latest main API version: latest main
What happened?
When I use
opentelemetry-instrument
on a script that sends a single span, the metrics SDK throws a ValueError on around half the runs. The script just gets a tracer and does a singlestart_as_current_span
, but I believeopentelemetry-system-metrics
is what runs in the background collecting and sending metrics.Steps to Reproduce
Use
opentelemetry-instrument
to run a script containing something like the followingExpected Result
No ValueError exceptions.
Actual Result
Additional context
On one run, I was able to print the metric before the ValueError and got:
The value that caused the error in this case was
10484362086929426074
, which is about 10^19.Would you like to implement a fix?
None