Skip to content

Commit

Permalink
Merge pull request #450 from duyet/chore/clarify-docs
Browse files Browse the repository at this point in the history
docs: update ClickHouse monitoring user privileges and explanations
  • Loading branch information
duyet authored Dec 18, 2024
2 parents 253a5bb + 684b507 commit 1ecd56d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions docs/pages/getting-started/clickhouse-requirements.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,26 @@ Suggested role for **monitoring** user must have these privileges on `system` da
<monitoring_role>
<grants>
<query>REVOKE ALL ON *.*</query>
<query>GRANT SELECT,SHOW,dictGet,REMOTE ON *.*</query>
<query>GRANT SELECT,INSERT,ALTER,CREATE,DROP,TRUNCATE,OPTIMIZE,SHOW,dictGet ON system.*</query>
<query>GRANT SELECT,SHOW,OPTIMIZE,dictGet,REMOTE ON *.*</query>
<query>GRANT CREATE TEMPORARY TABLE ON *.*</query>
<query>GRANT CREATE KILL QUERY ON *.*</query>
<query>GRANT SELECT,INSERT,ALTER,CREATE,DROP,TRUNCATE ON system.monitoring_events</query>
</grants>
</monitoring_role>
</roles>
</clickhouse>
```

`CREATE TEMPORARY TABLE` is needed because the UI using `FROM merge(system, '^query_log')` allows retrieving all the data from old tables that were renamed during the upgrade.
Privileges explains:

- `CREATE TEMPORARY TABLE` is needed because the UI uses `FROM merge(system, '^query_log')`, which allows retrieving all the data from old tables that were renamed during the upgrade.
- `OPTIMIZE` is needed for the table optimization action on Data Explorer.
- `KILL QUERY` is needed for the "Kill query" action on Running Queries.
- `INSERT`, `ALTER`, `CREATE`, `DROP`, and `TRUNCATE` are needed for the [feat: add pageview tracking #243](https://github.com/duyet/clickhouse-monitoring/pull/243) feature, which is [configurable](https://github.com/duyet/clickhouse-monitoring/pull/357). You should change `system.monitoring_events` to your own database and table.

![Optimize Table Action](/grant-optimize.png)

![Running Queries Action](/grant-kill.png)

## 2. Monitoring user profile

Expand Down
Binary file added docs/public/grant-kill.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/public/grant-optimize.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

1 comment on commit 1ecd56d

@vercel
Copy link

@vercel vercel bot commented on 1ecd56d Dec 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.