Skip to content

opentelemetry-instrumentation-system-metrics: psutil num_ctx_switches not working in google cloud run #3531

@xrmx

Description

@xrmx

Describe your environment

OS: (e.g, Ubuntu) ubuntu on cloud run
Python version: (e.g., Python 3.8.10) 3.11
Package version: (e.g., 0.46.0)

What happened?

psutils is raising a NotImplementedError exception in the num_ctx_switches function https://github.com/giampaolo/psutil/blob/master/psutil/_pslinux.py#L2094

Steps to Reproduce

Run the instrumentation in cloud run

Expected Result

The metrics not to be reported but my app working

Actual Result

My app not working

Additional context

We should check for the function working before creating the observable counter

Would you like to implement a fix?

Yes

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions