---
title: "Expose Prometheus metrics"
description: "Optional statistics about your bot for monitoring tools such as Prometheus and Grafana."
canonical_url: "https://docs.mute.yonn2222.com/monitoring/metrics"
---
# Expose Prometheus metrics

> Optional statistics about your bot for monitoring tools such as Prometheus and Grafana.

This page is for people who already run a monitoring tool. You can skip it otherwise. Metrics are off by default.

## Turn metrics on

Add this to the bot `config.json`:

```json
{
  "metrics": { "enabled": true, "host": "127.0.0.1", "port": 9464, "token": "a-long-random-string" }
}
```

The statistics are then available at `/metrics` on that address and port. Any other address answers with "not found".

- Keep `host` at `127.0.0.1` so only your own PC can read the numbers. `0.0.0.0` opens them to the whole network.
- `token` is an optional password with at least 16 characters. When it is set, requests must send it as `Authorization: Bearer <token>`.

Prometheus setup:

```yaml
scrape_configs:
  - job_name: discordmute
    metrics_path: /metrics
    authorization:
      type: Bearer
      credentials: a-long-random-string
    static_configs:
      - targets: ["127.0.0.1:9464"]
```

## Available metrics

<table>
<thead>
  <tr>
    <th>
      Metric
    </th>
    
    <th>
      Meaning
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        discordmute_plugin_events_total{type}
      </code>
    </td>
    
    <td>
      Events from plugins by type: <code>
        lobby
      </code>
      
      , <code>
        game-start
      </code>
      
      , <code>
        meeting-start
      </code>
      
      , <code>
        meeting-end
      </code>
      
      , <code>
        player-died
      </code>
      
      , <code>
        game-end
      </code>
      
      , <code>
        link-chat
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        discordmute_games_muted_total
      </code>
    </td>
    
    <td>
      Games for which muting was started.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        discordmute_plugins_connected
      </code>
    </td>
    
    <td>
      Plugins connected right now.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        discordmute_active_games
      </code>
    </td>
    
    <td>
      Games in progress right now.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        discordmute_plugin_sessions{plugin_version,game_version}
      </code>
    </td>
    
    <td>
      Connected plugins per plugin and Among Us version.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        discordmute_mutes_total{action}
      </code>
    </td>
    
    <td>
      Mutes and unmutes (<code>
        mute
      </code>
      
       or <code>
        unmute
      </code>
      
      ).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        discordmute_mute_failures_total
      </code>
    </td>
    
    <td>
      Mutes and unmutes that failed.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        discordmute_mute_latency_seconds
      </code>
    </td>
    
    <td>
      How long successful mutes and unmutes take.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        discordmute_rate_limit_hits_total
      </code>
    </td>
    
    <td>
      Times Discord slowed the bot down.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        discordmute_guilds
      </code>
    </td>
    
    <td>
      Discord servers the bot is in.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        discordmute_feature_guilds{feature}
      </code>
    </td>
    
    <td>
      Servers the bot is in that have an optional feature switched on, for example <code>
        ghostChat
      </code>
      
       or <code>
        serverLog
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        discordmute_cluster_guilds{cluster}
      </code>
    </td>
    
    <td>
      Servers per bot process.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        discordmute_cluster_ws_ping_seconds{cluster}
      </code>
    </td>
    
    <td>
      Connection delay to Discord per bot process.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        discordmute_cluster_snapshot_failures_total
      </code>
    </td>
    
    <td>
      Times a bot process did not answer a statistics request.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        discordmute_process_resident_memory_bytes{process}
      </code>
    </td>
    
    <td>
      Memory used per process.
    </td>
  </tr>
</tbody>
</table>


## Sitemap

See the full [sitemap](https://docs.mute.yonn2222.com/sitemap.md) for all pages.
