Skip to content
SoulFire LogoSoulFire

Get instance metrics

GET
/v1/instances/{instance_id}/metrics

Returns time-series metrics and current distributions for an instance. Supports incremental fetching via the "since" parameter.

Authorization

headerAuthorizationBearer <JWT>

Preferred API authentication. Use a JWT with the api audience.

Path Parameters

instance_id*string

The UUID of the SoulFire instance to get metrics for.

Formatuuid

Query Parameters

since?|

If set, only return snapshots taken after this timestamp. Used for incremental fetching to reduce payload size.

Response Body

Response containing time-series metrics and current distributions.

application/json
  1. response

Response containing time-series metrics and current distributions.

snapshots*array<>

Time-series snapshots ordered oldest to newest. Contains up to 600 snapshots (30 minutes at 3-second intervals). If the request included a "since" timestamp, only newer snapshots are returned.

distributions*

Current-state distributions computed from the latest bot data.

Example Request
curl -X GET 'http://127.0.0.1:38765/v1/instances/497f6eca-6276-4993-bfeb-53cbbbba6f08/metrics'
Example Response
{
  "snapshots": [
    {
      "timestamp": "2019-08-24T14:15:22Z",
      "botsOnline": 0,
      "botsTotal": 0,
      "packetsSentTotal": "string",
      "packetsReceivedTotal": "string",
      "bytesSentTotal": "string",
      "bytesReceivedTotal": "string",
      "packetsSentPerSecond": 0.1,
      "packetsReceivedPerSecond": 0.1,
      "bytesSentPerSecond": 0.1,
      "bytesReceivedPerSecond": 0.1,
      "avgTickDurationMs": 0.1,
      "maxTickDurationMs": 0.1,
      "avgHealth": 0.1,
      "avgFoodLevel": 0.1,
      "totalLoadedChunks": 0,
      "totalTrackedEntities": 0,
      "connections": 0,
      "disconnections": 0
    }
  ],
  "distributions": {
    "healthHistogram": [
      0
    ],
    "foodHistogram": [
      0
    ],
    "dimensionCounts": {
      "property1": 0,
      "property2": 0
    },
    "gameModeCounts": {
      "property1": 0,
      "property2": 0
    },
    "botPositions": [
      {
        "x": 0.1,
        "z": 0.1,
        "dimension": "string"
      }
    ]
  }
}

Was this page helpful?