Grafana Setup - xyzzy529/screeps.behaviour-action-pattern GitHub Wiki

For this guide, I will be using screepspl.us, however you can use another Grafana setup if you wish.

Grafana Graph


Prerequisites

  1. Screeps Login info
  2. Node + NPM

Setup

  1. First off, you want to install the agent. Download and extract the agent from this Github Repo.
  2. Run npm install to install required modules.
  3. Create your config file using cp config.example.js config.js
  4. Fill in your Screeps username and password. If you sign in with Steam, you will have to setup a password on your Screeps account settings.
  5. Login to ScreepsPlus, head to the agent setup page and get your token.
  6. Change sampleConfig to false.
  7. Set GRAFANA to true in your parameter.js (or viral.parameter.js)
  8. Run node app.js
  9. Go to Grafana
  10. Open Dashboard settings (gear icon after Dashboard name) and select Templating. Remove any existing templates and add a new one:
    1. Variable Name: rooms
    2. Data source: screepspl.us
    3. Refresh: On Dashboard Load
    4. Query: screeps.rooms.*
    5. Multi-value: true
    6. Include All option: true
    7. Value groups/tags Enabled: true
    8. Tags query: screeps.rooms.*
    9. Tag values query: screeps.rooms.$tag.level

Panel Examples

Some useful panel examples

CPU Usage

Panel Type: Singlestat
Metric Streams: Streams
Options Stat: current
Unit Stat: asPercent (0-100)

CPU/Bucket Graph

Panel Type: Graph
Metric Streams: Streams
Legend As Table: true
Legend To the right: true
Display Fill: 0
Line Width: 2
Series Override
Bucket: Y-axis: 2
Used: Line fill: 2

GCL Time

Panel Type: Singlestat
Metric Streams: Streams
Options Stat: avg
Options Postfix: s
Options Unit: seconds (s)