Skip to content

[backport] docs: Add instructions about profiling on macOS (#4202) #4207

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: release/v1.13
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions docs/sources/configure-client/language-sdks/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,25 @@ To capture and analyze profiling data, you need either a hosted Pyroscope OSS se

The Pyroscope server can be a local server for development or a remote server for production use.

### Profiling on macOS

macOS has a feature called System Integrity Protection (SIP) that prevents even the root user from reading memory from any binary located in system folders.

The easiest way to avoid interference from SIP, is by installing a Python distribution into your home folder. This can be achieved for example by using `pyenv`:

```bash
# Setup pyenv
brew update
brew install pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(pyenv init - zsh)"' >> ~/.zshrc
# Restart your shell
exec "$SHELL"
# Install Python 3.12
pyenv install 3.12
```

## Add Python profiling to your application

Install the `pyroscope-io` pip package:
Expand Down
Loading