Skip to content
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

Add instruction for using pg_activity #181

Merged
merged 1 commit into from
May 25, 2022
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## 3.8.0 (not released yet)

* Add documentation cookbook for using pg_activity

## 3.7.0 (2022-05-24)

* Add documentation cookbook for installing redirection.io
Expand Down
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,42 @@ services:

</details>

### How to pg_activity for monitoring PostgreSQL

<details>

<summary>Read the cookbook</summary>

In order to install pg_activity, you should add the following content to the
`infrastructure/docker/services/postgres/Dockerfile` file:

```Dockerfile
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
pg-activity \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
```

Then, you can add the following content to the `tasks.py` file:

```py
@task
def pg_activity(c):
"""
Monitor PostgreSQL
"""
docker_compose(c, 'exec postgres pg_activity -U app', bare_run=True)
```

Finally you can use the following command:

```
inv pg-activity
```

</details>

### How to use MySQL instead of PostgreSQL

<details>
Expand Down