# Litmus Edge 4.4.x - Integration: Prometheus Metrics

## Integration Prometheus Metrics

**GET** `{{edgeUrl}}/cc/metrics`

# Integration Prometheus Metrics

Returns the Integrations service's runtime metrics in the [Prometheus exposition format](https://prometheus.io/docs/instrumenting/exposition_formats/). Same scrape semantics as the DeviceHub and Marketplace Prometheus endpoints.

## Endpoint

```http
GET {{edgeUrl}}/cc/metrics
```

## Authentication

HTTP Basic Auth. **Username** is your API token, **password** is empty. Tokens are managed under `System > Access Control > Tokens`.

## Parameters

None.

## Response

`200 OK` -- `text/plain; version=0.0.4`. One labelled time series per instance for each metric. Every metric carries the `id` label, so PromQL joins on `id` are straightforward:

| Label     | Description                                  |
|-----------|----------------------------------------------|
| `id`      | Instance UUID (same as `InstanceID`).        |
| `name`    | Instance name (spaces replaced by `_`). On the `edge_cc_storage_*` metrics this label holds the queue mode (for example `lifo`) instead of the instance name, so join those series on `id`. |

### Metric reference

| Metric                          | Type     | Description                                                       |
|---------------------------------|----------|-------------------------------------------------------------------|
| `edge_cc_disk_usage`            | gauge    | Bytes used by the instance's persistence layer.                    |
| `edge_cc_messages_processed`    | counter  | Total messages the instance has processed since service start.     |
| `edge_cc_status`                | gauge    | Instance status value, `1` or `0` per instance.                    |
| `edge_cc_tags`                  | gauge    | Number of tags reported for the instance.                          |
| `edge_cc_storage_pop_speed`     | gauge    | Persistence-layer pop speed. Label `name` is the queue mode.       |
| `edge_cc_storage_push_speed`    | gauge    | Persistence-layer push speed. Label `name` is the queue mode.      |
| `edge_cc_storage_total_popped`  | gauge    | Persistence-layer total popped. Label `name` is the queue mode.    |
| `edge_cc_storage_total_pushed`  | gauge    | Persistence-layer total pushed. Label `name` is the queue mode.    |

The example below lists every metric family the service emitted on the reference device. Treat the list as open-ended, since additional metrics may be emitted depending on the build.

### Example response

```text
# HELP edge_cc_disk_usage
# TYPE edge_cc_disk_usage gauge
edge_cc_disk_usage{id="1c604e84-d29a-47d8-a53b-8f3017405835",name="default-ssl"} 0
edge_cc_disk_usage{id="843e6ca7-f995-4a5b-80ad-29610230cb7b",name="data-rate-test"} 0

# HELP edge_cc_messages_processed
# TYPE edge_cc_messages_processed counter
edge_cc_messages_processed{id="1c604e84-d29a-47d8-a53b-8f3017405835",name="default-ssl"} 116
```

### Scrape configuration

```yaml
- job_name: 'litmusedge-integration'
  scheme: https
  tls_config:
    insecure_skip_verify: true
  metrics_path: /cc/metrics
  basic_auth:
    username: '<api-token>'
    password: ''
  static_configs:
    - targets: ['<edge-host>:443']
```

### Useful PromQL recipes

```promql
# Per-instance message-processing rate over 5m
rate(edge_cc_messages_processed[5m])

# Top-5 instances by persistence-layer disk usage
topk(5, edge_cc_disk_usage)
```

## Errors

| HTTP status         | When it happens                                                                |
|---------------------|--------------------------------------------------------------------------------|
| `400 Bad Request`   | Malformed request. This endpoint takes no parameters.                          |
| `401 Unauthorized`  | Missing or invalid credentials.                                                |
| `403 Forbidden`     | Token lacks permission for this operation.                                     |
| `404 Not Found`     | Target entity does not exist.                                                  |
| `5xx`               | Service is unreachable, restarting, or internally errored. Inspect device logs under `System > Support`. |

> **TLS note**: edge devices use a self-signed certificate by default. Either install the device CA in your client trust store or disable certificate verification when calling this endpoint directly.


### Response

**Status**: 200 OK

```plain
# HELP edge_cc_disk_usage 
# TYPE edge_cc_disk_usage gauge
edge_cc_disk_usage{id="1c604e84-d29a-47d8-a53b-8f3017405835",name="default-ssl"} 0
edge_cc_disk_usage{id="843e6ca7-f995-4a5b-80ad-29610230cb7b",name="data-rate-test"} 0
edge_cc_disk_usage{id="c1736c10-804d-4d6e-9cbc-ba5f2cb7d4c0",name="ClarifyIOssl"} 0
edge_cc_disk_usage{id="f54a759c-f8e3-4905-8315-abb39eadf631",name="kafka"} 0
# HELP edge_cc_messages_processed 
# TYPE edge_cc_messages_processed counter
edge_cc_messages_processed{id="1c604e84-d29a-47d8-a53b-8f3017405835",name="default-ssl"} 116
edge_cc_messages_processed{id="843e6ca7-f995-4a5b-80ad-29610230cb7b",name="data-rate-test"} 0
edge_cc_messages_processed{id="c1736c10-804d-4d6e-9cbc-ba5f2cb7d4c0",name="ClarifyIOssl"} 2.775149e+06
edge_cc_messages_processed{id="f54a759c-f8e3-4905-8315-abb39eadf631",name="kafka"} 0
# HELP edge_cc_status 
# TYPE edge_cc_status gauge
edge_cc_status{id="1c604e84-d29a-47d8-a53b-8f3017405835",name="default-ssl"} 1
edge_cc_status{id="843e6ca7-f995-4a5b-80ad-29610230cb7b",name="data-rate-test"} 0
edge_cc_status{id="c1736c10-804d-4d6e-9cbc-ba5f2cb7d4c0",name="ClarifyIOssl"} 1
edge_cc_status{id="f54a759c-f8e3-4905-8315-abb39eadf631",name="kafka"} 1
# HELP edge_cc_storage_pop_speed 
# TYPE edge_cc_storage_pop_speed gauge
edge_cc_storage_pop_speed{id="1c604e84-d29a-47d8-a53b-8f3017405835",name="lifo"} 0
edge_cc_storage_pop_speed{id="843e6ca7-f995-4a5b-80ad-29610230cb7b",name="lifo"} 0
edge_cc_storage_pop_speed{id="c1736c10-804d-4d6e-9cbc-ba5f2cb7d4c0",name="lifo"} 0
edge_cc_storage_pop_speed{id="f54a759c-f8e3-4905-8315-abb39eadf631",name="lifo"} 0
# HELP edge_cc_storage_push_speed 
# TYPE edge_cc_storage_push_speed gauge
edge_cc_storage_push_speed{id="1c604e84-d29a-47d8-a53b-8f3017405835",name="lifo"} 0
edge_cc_storage_push_speed{id="843e6ca7-f995-4a5b-80ad-29610230cb7b",name="lifo"} 0
edge_cc_storage_push_speed{id="c1736c10-804d-4d6e-9cbc-ba5f2cb7d4c0",name="lifo"} 0
edge_cc_storage_push_speed{id="f54a759c-f8e3-4905-8315-abb39eadf631",name="lifo"} 0
# HELP edge_cc_storage_total_popped 
# TYPE edge_cc_storage_total_popped gauge
edge_cc_storage_total_popped{id="1c604e84-d29a-47d8-a53b-8f3017405835",name="lifo"} 0
edge_cc_storage_total_popped{id="843e6ca7-f995-4a5b-80ad-29610230cb7b",name="lifo"} 0
edge_cc_storage_total_popped{id="c1736c10-804d-4d6e-9cbc-ba5f2cb7d4c0",name="lifo"} 0
edge_cc_storage_total_popped{id="f54a759c-f8e3-4905-8315-abb39eadf631",name="lifo"} 0
# HELP edge_cc_storage_total_pushed 
# TYPE edge_cc_storage_total_pushed gauge
edge_cc_storage_total_pushed{id="1c604e84-d29a-47d8-a53b-8f3017405835",name="lifo"} 0
edge_cc_storage_total_pushed{id="843e6ca7-f995-4a5b-80ad-29610230cb7b",name="lifo"} 0
edge_cc_storage_total_pushed{id="c1736c10-804d-4d6e-9cbc-ba5f2cb7d4c0",name="lifo"} 0
edge_cc_storage_total_pushed{id="f54a759c-f8e3-4905-8315-abb39eadf631",name="lifo"} 0
# HELP edge_cc_tags 
# TYPE edge_cc_tags gauge
edge_cc_tags{id="1c604e84-d29a-47d8-a53b-8f3017405835",name="default-ssl"} 1
edge_cc_tags{id="843e6ca7-f995-4a5b-80ad-29610230cb7b",name="data-rate-test"} 2
edge_cc_tags{id="c1736c10-804d-4d6e-9cbc-ba5f2cb7d4c0",name="ClarifyIOssl"} 1
edge_cc_tags{id="f54a759c-f8e3-4905-8315-abb39eadf631",name="kafka"} 0

```

---

