File tree 1 file changed +12
-10
lines changed
instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics
1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change 92
92
from opentelemetry .metrics import CallbackOptions , Observation , get_meter
93
93
from opentelemetry .sdk .util import get_dict_as_key
94
94
95
- logger = logging .getLogger (__name__ )
95
+ _logger = logging .getLogger (__name__ )
96
96
97
97
98
98
_DEFAULT_CONFIG = {
@@ -355,16 +355,18 @@ def _instrument(self, **kwargs):
355
355
unit = "seconds" ,
356
356
)
357
357
358
- if "process.runtime.gc_count" in self ._config and self ._python_implementation != "pypy" :
359
- logger .warning (
360
- "The process.runtime.gc_count metric won't be collected because the interpreter is PyPy"
358
+ if "process.runtime.gc_count" in self ._config :
359
+ if self ._python_implementation == "pypy" :
360
+ _logger .warning (
361
+ "The process.runtime.gc_count metric won't be collected because the interpreter is PyPy"
362
+ )
363
+ else :
364
+ self ._meter .create_observable_counter (
365
+ name = f"process.runtime.{ self ._python_implementation } .gc_count" ,
366
+ callbacks = [self ._get_runtime_gc_count ],
367
+ description = f"Runtime { self ._python_implementation } GC count" ,
368
+ unit = "bytes" ,
361
369
)
362
- self ._meter .create_observable_counter (
363
- name = f"process.runtime.{ self ._python_implementation } .gc_count" ,
364
- callbacks = [self ._get_runtime_gc_count ],
365
- description = f"Runtime { self ._python_implementation } GC count" ,
366
- unit = "bytes" ,
367
- )
368
370
369
371
370
372
if "process.runtime.thread_count" in self ._config :
You can’t perform that action at this time.
0 commit comments