Skip to content

Commit f347716

Browse files
adriangbsrikanthccvshalevr
authored
Don't collect system.network.connections due to limitation in psutil causing exceptions (#2008)
* Don't collect system.network.connections due to limitation in psutil causing exceptions * add changelog --------- Co-authored-by: Srikanth Chekuri <[email protected]> Co-authored-by: Shalev Roda <[email protected]>
1 parent 6f6c28d commit f347716

File tree

2 files changed

+7
-0
lines changed
  • instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics

2 files changed

+7
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3131
([#1980](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1980))
3232
- `opentelemetry-resource-detector-azure` Using new Cloud Resource ID attribute.
3333
([#1976](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1976))
34+
- Do not collect `system.network.connections` by default on macOS which was causing exceptions in metrics collection.
35+
([#2008](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2008))
3436

3537
## Version 1.20.0/0.41b0 (2023-09-01)
3638

instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777

7878
import gc
7979
import os
80+
import sys
8081
import logging
8182
import threading
8283
from platform import python_implementation
@@ -119,6 +120,10 @@
119120
"process.runtime.context_switches": ["involuntary", "voluntary"],
120121
}
121122

123+
if sys.platform == "darwin":
124+
# see https://github.com/giampaolo/psutil/issues/1219
125+
_DEFAULT_CONFIG.pop("system.network.connections")
126+
122127

123128
class SystemMetricsInstrumentor(BaseInstrumentor):
124129
def __init__(

0 commit comments

Comments
 (0)