grafana / grafana/pyroscope-python

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

Aperta
#45 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Rust
Stelle
4
Fork
2
Merge medio
2g 4h
PR unite (30g)
5

Descrizione

#### 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

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.