Skip to content

Commit

Permalink
Changes requested by external reviewer
Browse files Browse the repository at this point in the history
Co-authored-by: Suryanarayana Peri <[email protected]>

Signed-off-by: Rahul Kumar <[email protected]>
  • Loading branch information
rahulhacker committed Nov 16, 2023
1 parent 9eb44c6 commit f7c934f
Showing 1 changed file with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
from opentelemetry.metrics import CallbackOptions, Observation, get_meter
from opentelemetry.sdk.util import get_dict_as_key

logger = logging.getLogger(__name__)
_logger = logging.getLogger(__name__)


_DEFAULT_CONFIG = {
Expand Down Expand Up @@ -355,16 +355,18 @@ def _instrument(self, **kwargs):
unit="seconds",
)

if "process.runtime.gc_count" in self._config and self._python_implementation != "pypy":
logger.warning(
"The process.runtime.gc_count metric won't be collected because the interpreter is PyPy"
if "process.runtime.gc_count" in self._config:
if self._python_implementation == "pypy":
_logger.warning(
"The process.runtime.gc_count metric won't be collected because the interpreter is PyPy"
)
else:
self._meter.create_observable_counter(
name=f"process.runtime.{self._python_implementation}.gc_count",
callbacks=[self._get_runtime_gc_count],
description=f"Runtime {self._python_implementation} GC count",
unit="bytes",
)
self._meter.create_observable_counter(
name=f"process.runtime.{self._python_implementation}.gc_count",
callbacks=[self._get_runtime_gc_count],
description=f"Runtime {self._python_implementation} GC count",
unit="bytes",
)


if "process.runtime.thread_count" in self._config:
Expand Down

0 comments on commit f7c934f

Please sign in to comment.