grafana / grafana/pyroscope-python

pyroscope not working on bare-metal python process with uvloop and numba libraries

Đang mở
#45 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Rust
Star
4
Fork
2
Merge trung bình
2 ngày 4 giờ
Pull request đã merge (30 ngày)
5

Mô tả

#### Describe the bug

The pyroscope python agent does not work correctly on Mac OS.

#### To Reproduce

Native libraries being used:
"msgspec==0.19.0",
"pyroscope-io>=0.8.11",
"uvloop>=0.21.0,
"numba==0.61.2",
"gunicorn>=23.0.0,
"uvicorn-worker==0.3.0",
"uvicorn[standard]>=0.34.3",

Minimal pyroscope configuration (see below). Spans configured as

```python
with pyroscope.tag_wrapper({"endpoint": "/my-endpoont"}):
....
```

Pyroscope server running as a docker container using docker-compose:

```docker
pyroscope:
image: grafana/pyroscope:latest
container_name: pyroscope
ports:
- "4040:4040"
volumes:
- pyroscope-storage:/var/lib/pyroscope
command: ["server"]
restart: unless-stopped
networks:
- my_network

volumes:
pyroscope-storage:
```

#### Expected behavior

I would expect the application to report data, but I can't see any of my data in the Grafana Pyroscope data-source.

When i start my process, I either get these logs on console

```
2025-08-04T10:51:14.395Z WARN py_spy::python_process_info > Interpreter address from _PyRuntime symbol is invalid 0000000000000000
2025-08-04T10:51:14.449Z WARN py_spy::python_process_info > Interpreter address from _PyRuntime symbol is invalid 0000000000000000
```

when using a simple configuration such as

```python
pyroscope.configure(
application_name="my-service",
server_address=os.getenv("PYROSCOPE_SERVER_ADDRESS", "http://localhost:4040"),
enable_logging=True
)
```

or something like

```
2025-08-04T10:59:38.562Z WARN py_spy::sampler > Failed to get initialization status from PythonSpyThread: receiving on a closed channel
2025-08-04T10:59:38.667Z WARN py_spy::sampler > Failed to get initialization status from PythonSpyThread: receiving on a closed channel
```

when adding this option to the configuration

```python
detect_subprocesses=True,
```

#### Environment

- Deployment tool: uv 0.7.13
- Python version: 3.13.5 (3.13.5 (main, Jun 12 2025, 12:22:43) [Clang 20.1.4 ])
- Platform: macOS-15.5-arm64-arm-64bit-Mach-O

#### Additional Context

I have a python application using some native libaries such as msgspec, uvloop, Numba, uvicorn, or gunicorn
I am running my application as a Mac OS process

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.