Skip to content
Open

Main #569

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
54 changes: 54 additions & 0 deletions self-hosted/configuration/monitoring/apm-and-error-monitoring.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
title: APM and Tracing
description: Configure APM and error monitoring tools for Chatwoot
sidebarTitle: APM and Tracing
---
Comment on lines +1 to +5
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Connect new monitoring pages to navigation or remove them

The new self-hosted/configuration/monitoring/* pages are added, but no navigation or link updates accompany them; docs.json still points readers to self-hosted/monitoring/* (lines 98-100), and existing internal links do the same. As committed, these pages are effectively unused duplicates, which makes future documentation updates error-prone because there are now two parallel copies.

Useful? React with 👍 / 👎.


Chatwoot supports various APM and monitoring tools.
You can enable them by configuring the given environment variables.

## [Sentry](https://sentry.io/)

Provide your `sentry dsn`.

```bash
SENTRY_DSN=
```

## [Scout](https://scoutapm.com)
Provide values for the following environment variables. Refer [scout documentation](https://scoutapm.com/docs/ruby/configuration) for additional options.
```bash
## https://scoutapm.com/docs/ruby/configuration
# SCOUT_KEY=YOURKEY
# SCOUT_NAME=YOURAPPNAME (Production)
# SCOUT_MONITOR=true
```

## [NewRelic](https://newrelic.com/)
Enable Newrelic by configuring the license key. Refer [newrelic documentation](https://docs.newrelic.com/docs/agents/ruby-agent/configuration/ruby-agent-configuration/) for additional options.

```bash
# https://docs.newrelic.com/docs/agents/ruby-agent/configuration/ruby-agent-configuration/
# NEW_RELIC_LICENSE_KEY=
```

## [DataDog](https://www.datadoghq.com/)

Datadog requires an agent running on the host machine to which the tracing library can send data. Chatwoot ruby code contains the tracing library, but you need to configure the agent in your host machine/docker environment for the integration to work.

Enable Datadog in chatwoot by configuring the `trace agent url`.

```bash
## https://github.com/DataDog/dd-trace-rb/blob/master/docs/GettingStarted.md#environment-variables
# DD_TRACE_AGENT_URL=http://localhost:8126
```

### Running Datadog agent in local via docker
```bash
# to run in your local machine binding to port 8126
# replace <dd API key> and dd_site as required

docker run -d --name dd-agent -v /var/run/docker.sock:/var/run/docker.sock:ro -v /proc/:/host/proc/:ro -v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro -p 8126:8126 -e DD_API_KEY=<dd api key> -e DD_SITE="datadoghq.com" gcr.io/datadoghq/agent:7
```

Refer Datadog documentation to install the agent in specific environments like [Ubuntu](https://docs.datadoghq.com/agent/basic_agent_usage/ubuntu/?tab=agentv6v7), [Docker](https://docs.datadoghq.com/agent/docker/?tab=standard), [kubernetes](https://docs.datadoghq.com/agent/kubernetes/?tab=helm) etc.
38 changes: 38 additions & 0 deletions self-hosted/configuration/monitoring/rate-limiting.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
title: Rate Limiting
description: Configure rate limiting to protect your Chatwoot installation from abuse
sidebarTitle: Rate Limiting
---

To protect the system from abusive requests, Chatwoot makes use of [`rack_attack`](https://github.com/rack/rack-attack) gem.
You could customize the configuration to suit your needs by updating, [`config/initializers/rack_attack.rb`](https://github.com/chatwoot/chatwoot/blob/develop/config/initializers/rack_attack.rb)

## Default Rate Limits

- Chatwoot will throttles requests by IP at `60rpm`, Unless the request is from an allowed IP `['127.0.0.1', '::1']`
- Signup Requests are limited by IP at `5 requests` per `5 minutes`.
- SignIn Requests are limited by IP at `5 requests` per `20 seconds`.
- SignIn Requests are limited by email address at `20 requests` per `5 minutes` for a specific email.
- Reset Password Requests are limited at `5 requests` per `1 hour` for a specific email.

## Attachment Restrictions

- `Contact/Inbox Avatar` attachment file types are limited to jpeg, gif and png.
- `Contact/Inbox Avatar` attachment file size is limited to 15MB.
- `Website Channel` message attachments are limited to types ['image/png', 'image/jpeg', 'image/gif', 'image/bmp', 'image/tiff', 'application/pdf', 'audio/mpeg', 'video/mp4', 'audio/ogg', 'text/csv']
- `Website Channel` message attachments are limited to 40MB size limit.

## Disabling Rack attack on your instance

You can control the behaviour of rack attack in your instance via the following environment variables.

```bash
## Rack Attack configuration
## To prevent and throttle abusive requests.
# Disable if you are getting too many request errors for custom use cases
# ENABLE_RACK_ATTACK=true
# Control the allowed number of requests
# RACK_ATTACK_LIMIT=300
# Control whether you want to enable rack attack for widget APIs
# ENABLE_RACK_ATTACK_WIDGET_API=true
```
41 changes: 41 additions & 0 deletions self-hosted/configuration/monitoring/super-admin-sidekiq.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
title: Super Admin Console
description: Guide to accessing and using the Super Admin Console and Sidekiq monitoring
sidebarTitle: Super Admin Console
---

You will need a user account with super admin privileges to access the super admin console and Sidekiq console.

<Note>
The first user created during onboarding is a `super admin`.
</Note>

## Access superadmin console

- Access `<chatwoot-installation-url>/super_admin`.

## Creating new super admins

- Use the super admin console and navigate to the user's section
- Click on the new user button, fill in the details, and select the type to be `super admin`

## Access Sidekiq via the super admin console

- Access `<chatwoot-installation-url>/super_admin`.
- Authenticate using the admin credentials created during the installation.
- You can access the Sidekiq option on the sidebar.

## Access Rails console

Run the following command in your console from the root folder of your Chatwoot Rails app.

```bash
RAILS_ENV=production bundle exec rails c
```
If you have `cwctl`, use `cwctl --console`.

- If you running Chatwoot in a Docker container, you would need to access the shell inside your container first.
- If you are running Chatwoot on Caprover, use the following command to access the command line.
```bash
docker exec -it $(docker ps --filter name=srv-captain--chatwoot-web -q) /bin/sh
```
54 changes: 54 additions & 0 deletions self-hosted/monitoring copy/apm-and-error-monitoring.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
title: APM and Tracing
description: Configure APM and error monitoring tools for Chatwoot
sidebarTitle: APM and Tracing
---
Comment on lines +1 to +5
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Remove unintended duplicate docs under monitoring copy

This file is a verbatim duplicate of self-hosted/monitoring/apm-and-error-monitoring.mdx, and the same duplicate pattern appears for the other monitoring pages in self-hosted/monitoring copy/. Because this new directory is not referenced anywhere in docs.json (navigation still uses self-hosted/monitoring/* at lines 98-100), it introduces orphaned duplicate content that will drift and confuse future edits.

Useful? React with 👍 / 👎.


Chatwoot supports various APM and monitoring tools.
You can enable them by configuring the given environment variables.

## [Sentry](https://sentry.io/)

Provide your `sentry dsn`.

```bash
SENTRY_DSN=
```

## [Scout](https://scoutapm.com)
Provide values for the following environment variables. Refer [scout documentation](https://scoutapm.com/docs/ruby/configuration) for additional options.
```bash
## https://scoutapm.com/docs/ruby/configuration
# SCOUT_KEY=YOURKEY
# SCOUT_NAME=YOURAPPNAME (Production)
# SCOUT_MONITOR=true
```

## [NewRelic](https://newrelic.com/)
Enable Newrelic by configuring the license key. Refer [newrelic documentation](https://docs.newrelic.com/docs/agents/ruby-agent/configuration/ruby-agent-configuration/) for additional options.

```bash
# https://docs.newrelic.com/docs/agents/ruby-agent/configuration/ruby-agent-configuration/
# NEW_RELIC_LICENSE_KEY=
```

## [DataDog](https://www.datadoghq.com/)

Datadog requires an agent running on the host machine to which the tracing library can send data. Chatwoot ruby code contains the tracing library, but you need to configure the agent in your host machine/docker environment for the integration to work.

Enable Datadog in chatwoot by configuring the `trace agent url`.

```bash
## https://github.com/DataDog/dd-trace-rb/blob/master/docs/GettingStarted.md#environment-variables
# DD_TRACE_AGENT_URL=http://localhost:8126
```

### Running Datadog agent in local via docker
```bash
# to run in your local machine binding to port 8126
# replace <dd API key> and dd_site as required

docker run -d --name dd-agent -v /var/run/docker.sock:/var/run/docker.sock:ro -v /proc/:/host/proc/:ro -v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro -p 8126:8126 -e DD_API_KEY=<dd api key> -e DD_SITE="datadoghq.com" gcr.io/datadoghq/agent:7
```

Refer Datadog documentation to install the agent in specific environments like [Ubuntu](https://docs.datadoghq.com/agent/basic_agent_usage/ubuntu/?tab=agentv6v7), [Docker](https://docs.datadoghq.com/agent/docker/?tab=standard), [kubernetes](https://docs.datadoghq.com/agent/kubernetes/?tab=helm) etc.
38 changes: 38 additions & 0 deletions self-hosted/monitoring copy/rate-limiting.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
title: Rate Limiting
description: Configure rate limiting to protect your Chatwoot installation from abuse
sidebarTitle: Rate Limiting
---

To protect the system from abusive requests, Chatwoot makes use of [`rack_attack`](https://github.com/rack/rack-attack) gem.
You could customize the configuration to suit your needs by updating, [`config/initializers/rack_attack.rb`](https://github.com/chatwoot/chatwoot/blob/develop/config/initializers/rack_attack.rb)

## Default Rate Limits

- Chatwoot will throttles requests by IP at `60rpm`, Unless the request is from an allowed IP `['127.0.0.1', '::1']`
- Signup Requests are limited by IP at `5 requests` per `5 minutes`.
- SignIn Requests are limited by IP at `5 requests` per `20 seconds`.
- SignIn Requests are limited by email address at `20 requests` per `5 minutes` for a specific email.
- Reset Password Requests are limited at `5 requests` per `1 hour` for a specific email.

## Attachment Restrictions

- `Contact/Inbox Avatar` attachment file types are limited to jpeg, gif and png.
- `Contact/Inbox Avatar` attachment file size is limited to 15MB.
- `Website Channel` message attachments are limited to types ['image/png', 'image/jpeg', 'image/gif', 'image/bmp', 'image/tiff', 'application/pdf', 'audio/mpeg', 'video/mp4', 'audio/ogg', 'text/csv']
- `Website Channel` message attachments are limited to 40MB size limit.

## Disabling Rack attack on your instance

You can control the behaviour of rack attack in your instance via the following environment variables.

```bash
## Rack Attack configuration
## To prevent and throttle abusive requests.
# Disable if you are getting too many request errors for custom use cases
# ENABLE_RACK_ATTACK=true
# Control the allowed number of requests
# RACK_ATTACK_LIMIT=300
# Control whether you want to enable rack attack for widget APIs
# ENABLE_RACK_ATTACK_WIDGET_API=true
```
41 changes: 41 additions & 0 deletions self-hosted/monitoring copy/super-admin-sidekiq.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
title: Super Admin Console
description: Guide to accessing and using the Super Admin Console and Sidekiq monitoring
sidebarTitle: Super Admin Console
---

You will need a user account with super admin privileges to access the super admin console and Sidekiq console.

<Note>
The first user created during onboarding is a `super admin`.
</Note>

## Access superadmin console

- Access `<chatwoot-installation-url>/super_admin`.

## Creating new super admins

- Use the super admin console and navigate to the user's section
- Click on the new user button, fill in the details, and select the type to be `super admin`

## Access Sidekiq via the super admin console

- Access `<chatwoot-installation-url>/super_admin`.
- Authenticate using the admin credentials created during the installation.
- You can access the Sidekiq option on the sidebar.

## Access Rails console

Run the following command in your console from the root folder of your Chatwoot Rails app.

```bash
RAILS_ENV=production bundle exec rails c
```
If you have `cwctl`, use `cwctl --console`.

- If you running Chatwoot in a Docker container, you would need to access the shell inside your container first.
- If you are running Chatwoot on Caprover, use the following command to access the command line.
```bash
docker exec -it $(docker ps --filter name=srv-captain--chatwoot-web -q) /bin/sh
```
Loading