-
-
Notifications
You must be signed in to change notification settings - Fork 977
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 documentation for metrics available #1213
Draft
ThisIsMissEm
wants to merge
1
commit into
mastodon:main
Choose a base branch
from
ThisIsMissEm:add-documentation-for-metrics
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+86
−0
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
--- | ||
title: Monitoring & Metrics for your server | ||
descriptions: Metrics available to help with monitoring | ||
menu: | ||
docs: | ||
weight: 100 | ||
parent: admin | ||
--- | ||
|
||
Mastodon provides various metrics to help you monitor the performance and load | ||
of | ||
|
||
## Web & Sidekiq Metrics | ||
|
||
Mastodon uses the [NSA gem](https://github.com/localshred/nsa) to collect | ||
various metrics for the Web and Sidekiq processes. If configured by setting the | ||
[`STATSD_ADDR`](/admin/config#statsd) environment variable, the metrics are | ||
published to statsd under the [`STATSD_NAMESPACE`](/admin/config#statsd) | ||
namespace. | ||
|
||
The following metrics are available: | ||
|
||
### Controllers | ||
|
||
| Type | Name | Description | | ||
| --------- | --------------------------------------------------------- | ----------- | | ||
| Timing | `web.{controller}.{action}.{format}.total_duration` | | | ||
| Timing | `web.{controller}.{action}.{format}.db_time` | | | ||
| Timing | `web.{controller}.{action}.{format}.view_time` | | | ||
| Increment | `web.{controller}.{action}.{format}.status.{status_code}` | | | ||
|
||
### Database: | ||
|
||
| Type | Name | Description | | ||
| ------ | ------------------------------------------------ | ----------- | | ||
| Timing | `db.tables.{table_name}.queries.delete.duration` | | | ||
| Timing | `db.tables.{table_name}.queries.insert.duration` | | | ||
| Timing | `db.tables.{table_name}.queries.select.duration` | | | ||
| Timing | `db.tables.{table_name}.queries.update.duration` | | | ||
|
||
### Cache: | ||
|
||
| Type | Name | Description | | ||
| ------ | -------------------------- | ----------- | | ||
| Timing | `cache.delete.duration` | | | ||
| Timing | `cache.exist?.duration` | | | ||
| Timing | `cache.fetch_hit.duration` | | | ||
| Timing | `cache.generate.duration` | | | ||
| Timing | `cache.read_hit.duration` | | | ||
| Timing | `cache.read_miss.duration` | | | ||
| Timing | `cache.read_miss.duration` | | | ||
|
||
### Sidekiq: | ||
|
||
| Type | Name | Description | | ||
| --------- | --------------------------------------- | ----------- | | ||
| Timing | `sidekiq.{worker_name}.processing_time` | | | ||
| Increment | `sidekiq.{worker_name}.success` | | | ||
| Increment | `sidekiq.{worker_name}.failure` | | | ||
| Gauge | `sidekiq.queues.{queue_name}.enqueued` | | | ||
| Gauge | `sidekiq.queues.{queue_name}.latency` | | | ||
| Gauge | `sidekiq.dead_size` | | | ||
| Gauge | `sidekiq.enqueued` | | | ||
| Gauge | `sidekiq.failed` | | | ||
| Gauge | `sidekiq.processed` | | | ||
| Gauge | `sidekiq.processes_size` | | | ||
| Gauge | `sidekiq.retry_size` | | | ||
| Gauge | `sidekiq.scheduled_size` | | | ||
| Gauge | `sidekiq.workers_size` | | | ||
|
||
## Streaming | ||
|
||
The streaming server reports metrics via a prometheus metrics endpoint located | ||
at `/metrics` on the streaming server. In order to collect these metrics, you'll | ||
need to make a request directly to the streaming server. | ||
|
||
The following metrics are available: | ||
|
||
| Type | Name | Description | | ||
| --------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | | ||
| Gauge | pg_pool_total_connections | The total number of clients existing within the postgresql pool | | ||
| Gauge | pg_pool_idle_connections | The number of clients which are not checked out but are currently idle in the postgresql pool | | ||
| Gauge | pg_pool_waiting_queries | The number of queued requests waiting on a postgresql client when all clients are checked out | | ||
| Gauge | connected_clients | The number of clients connected to the streaming server, these are labelled with the type of connection: `http` or `websocket` | | ||
| Gauge | connected_channels | The number of Redis channels the streaming server is subscribed to | | ||
| Histogram | streaming_latency | The time delta between when an event is published to redis from Ruby and when the streaming server processes that event | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note: this is a new metric (see: mastodon/mastodon#24886 ) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: The labelling is added in: mastodon/mastodon#24886