Skip to content
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

[instrumentation-system-metrics] add support for pypy3 #1033

Open
codeboten opened this issue Apr 6, 2022 · 5 comments · May be fixed by #1836
Open

[instrumentation-system-metrics] add support for pypy3 #1033

codeboten opened this issue Apr 6, 2022 · 5 comments · May be fixed by #1836
Assignees
Labels

Comments

@codeboten
Copy link
Contributor

Some of the metrics gathered in opentelemetry-instrumentation-system-metrics are different in pypy3. For example, the following method fails on pypy3:

module 'gc' has no attribute 'get_count'

Instead, getting counts for garbage collection is done via GC hooks. See the following for more details:
https://doc.pypy.org/en/latest/gc_info.html

The work in this issue is to make the instrumentation either produce all the same metrics or exclude the instruments that don't have equivalents. Ideally at the end of this issue, the tests for this instrumentation library will be enabled in tox for pypy3.

@codeboten codeboten added good first issue Good for newcomers help wanted Extra attention is needed instrumentation feature-request labels Apr 6, 2022
@rahuldimri
Copy link
Contributor

@codeboten Can I work on this ? if this feature not yet implemented.

@rahulhacker
Copy link
Contributor

@srikanthccv can you please assign this to me, as we made some progress on this issue.

@rahuldimri rahuldimri removed their assignment Jun 2, 2023
@rahulhacker
Copy link
Contributor

@srikanthccv can you please assign this to me, as we made some progress on this issue.

@rahulhacker
Copy link
Contributor

rahulhacker commented Jun 4, 2023

@srikanthccv
Approach:
We implemented the changes in the init.py file in the function def _get_runtime_gc_count
Handled the Cpython and PyPy using platform package, for PyPy we used GCHooks class) as mentioned in the document to achieve the gc.gc_count of Cpython in PyPy and same code running in the Cpython. Will raise the PR in some days along with the test cases, just want to confirm if we are in the right path.

Below are the sample output we are getting for PyPy3.
image

Note: Going to create a new file or include in the same file GCHooks Class as mentioned in above link, in order to get the objects for gc in PyPy

@rahulhacker rahulhacker linked a pull request Jun 6, 2023 that will close this issue
11 tasks
@ocelotl
Copy link
Contributor

ocelotl commented Oct 23, 2023

@srikanthccv Approach: We implemented the changes in the init.py file in the function def _get_runtime_gc_count Handled the Cpython and PyPy using platform package, for PyPy we used GCHooks class) as mentioned in the document to achieve the gc.gc_count of Cpython in PyPy and same code running in the Cpython. Will raise the PR in some days along with the test cases, just want to confirm if we are in the right path.

Below are the sample output we are getting for PyPy3. image

Note: Going to create a new file or include in the same file GCHooks Class as mentioned in above link, in order to get the objects for gc in PyPy

Out of curiosity, @rahulhacker, how did you implement the hook for gc_count?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants