> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ocient.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Statistics Monitoring

export const Telegraf = "Telegraf™";

export const OcientDataIntelligencePlatform = "OcientAIQ™ Unified Data Platform";

The {OcientDataIntelligencePlatform} maintains many internal statistics. You can access the statistics on each node in the database using a REST interface that listens on port 9090 by default. For the endpoints, see [System Information REST Endpoints](/system-information-rest-endpoints).

Explore the statistics using a command such as curl.

```curl CURL theme={null}
curl http://oc1-lts0:9090/v1/stats
```

The resulting statistics return in JSON format. This excerpt shows only a partial list of the results.

```json JSON theme={null}
[{
   {
        "name": "localStorageService.device[SDM00001A616].spaceFree",
        "node": "oc1-lts0",
        "time": 1591737983812323,
        "units": "bytes",
        "value": 356599726080
   },
   {
        "name": "localStorageService.device[SDM00001A616].spaceFreePct",
        "node": "oc1-lts0",
        "time": 1591737983812323,
        "units": "none",
        "value": 4631469015491373042
   },
   {
        "name": "localStorageService.device[SDM00001A616].spaceTotal",
        "node": "oc1-lts0",
        "time": 1591737983812323,
        "units": "bytes",
        "value": 800149299200
   }
}]
```

Because each node can produce a very large number of statistics, the REST interface supports wildcard filtering.

Return statistics that match the regular expression `^localStorageService*` using this curl command.

```curl CURL theme={null}
curl -G --data-urlencode 'filter=^localStorageService*' http://oc1-lts0:9090/v1/stats
```

The resulting subset of statistics returns in JSON format.

```json JSON theme={null}
[
    {
        "name": "localStorageService.device.segmentTableEntries",
        "time": "1684931806764193",
        "timestamp": "2023-05-24T12:36:46.764Z",
        "node": "sql0",
        "value": 1,
        "device": "4568d611-9ea9-4f65-d0z9-8gg5bb220750"
    },
    {
        "name": "localStorageService.device.spaceFree",
        "time": "1684931806764193",
        "timestamp": "2023-05-24T12:36:46.764Z",
        "node": "sql0",
        "value": 0,
        "device": "4568d611-9ea9-4f65-d0z9-8gg5bb220750"
    },
    {
        "name": "localStorageService.device.spaceFreePct",
        "time": "1684931806764193",
        "timestamp": "2023-05-24T12:36:46.764Z",
        "node": "sql0",
        "value": 0.000000,
        "device": "4568d611-9ea9-4f65-d0z9-8gg5bb220750"
    },
    {
        "name": "localStorageService.device.spaceTotal",
        "time": "1684931806764193",
        "timestamp": "2023-05-24T12:36:46.764Z",
        "node": "sql0",
        "value": 2139074560,
        "device": "4568d611-9ea9-4f65-d0z9-8gg5bb220750"
    },
    {
        "name": "localStorageService.device.status",
        "time": "1684931806764193",
        "timestamp": "2023-05-24T12:36:46.764Z",
        "node": "sql0",
        "value": 10,
        "device": "4568d611-9ea9-4f65-d0z9-8gg5bb220750"
    },
    {
        "name": "localStorageService.device.segmentTableEntries",
        "time": "1684931806764193",
        "timestamp": "2023-05-24T12:36:46.764Z",
        "node": "sql0",
        "value": 1,
        "device": "4568d611-9ea9-4f65-d0z9-8gg5bb220750"
    },
    {
        "name": "localStorageService.device.spaceFree",
        "time": "1684931806764193",
        "timestamp": "2023-05-24T12:36:46.764Z",
        "node": "sql0",
        "value": 0,
        "device": "4568d611-9ea9-4f65-d0z9-8gg5bb220750"
    },
    {
        "name": "localStorageService.device.spaceFreePct",
        "time": "1684931806764193",
        "timestamp": "2023-05-24T12:36:46.764Z",
        "node": "sql0",
        "value": 0.000000,
        "device": "4568d611-9ea9-4f65-d0z9-8gg5bb220750"
    },
    {
        "name": "localStorageService.device.spaceTotal",
        "time": "1684931806764193",
        "timestamp": "2023-05-24T12:36:46.764Z",
        "node": "sql0",
        "value": 2139074560,
        "device": "4568d611-9ea9-4f65-d0z9-8gg5bb220750"
    },
    {
        "name": "localStorageService.device.status",
        "time": "1684931806764193",
        "timestamp": "2023-05-24T12:36:46.764Z",
        "node": "sql0",
        "value": 10,
        "device": "4568d611-9ea9-4f65-d0z9-8gg5bb220750"
    }
]
```

<Info>
  The specific set of statistics is subject to change.
</Info>

## Retrieve Statistics Using Telegraf

{Telegraf} is a commonly used monitoring tool. This example shows the configuration file for Telegraf that gathers statistics from a database node where the statistic name includes `localStorageService`.

```Text Text theme={null}
; Read formatted metrics from one or more HTTP endpoints
[[inputs.http]]
  interval = "30s"

  urls = [
    "http://oc1-lts0:9090/v1/stats?filter=localStorageService"
  ]

  ; HTTP method
  method = "GET"

  data_format = "json"
  json_name_key = "name"
  json_time_key = "time"
  json_time_format = "unix_us"
  json_timezone = "America/Chicago"
  tag_keys = [
    "node",
    "silo",
    "core"
  ]
  [inputs.http.tags]
    source = "rolehostd"
```

## Related Links

[Install an Ocient System](/install-an-ocient-system)
