Skip to content

Commit

Permalink
Don't collect system.network.connections due to limitation in psutil …
Browse files Browse the repository at this point in the history
…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]>
  • Loading branch information
3 people authored Nov 17, 2023
1 parent 6f6c28d commit f347716
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#1980](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1980))
- `opentelemetry-resource-detector-azure` Using new Cloud Resource ID attribute.
([#1976](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1976))
- Do not collect `system.network.connections` by default on macOS which was causing exceptions in metrics collection.
([#2008](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2008))

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@

import gc
import os
import sys
import logging
import threading
from platform import python_implementation
Expand Down Expand Up @@ -119,6 +120,10 @@
"process.runtime.context_switches": ["involuntary", "voluntary"],
}

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


class SystemMetricsInstrumentor(BaseInstrumentor):
def __init__(
Expand Down

0 comments on commit f347716

Please sign in to comment.