> For the complete documentation index, see [llms.txt](https://docs.cennso.com/components/tposs/latest/llms.txt) (all documentation: [llms.txt](https://docs.cennso.com/llms.txt)). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cennso.com/components/tposs/latest/observability/diameter.md).

# Diameter metrics

> [!TIP]
> If **scg.diameter.enabled** is set to `false`, the Diameter metrics stay at `0`.
>
> For the metrics endpoint, the export formats, and the conventions that apply to all the metrics, see the [Metrics](https://docs.cennso.com/components/tposs/latest/observability/metrics.md) document.

TPOSS exposes the following Diameter metrics:

| Metric | Type | Labels | Description |
|---|---|---|---|
| diameter_requests_gx_total | counter | type | Total number of Gx requests received by TPOSS |
| diameter_requests_gy_total | counter | type | Total number of Gy requests received by TPOSS |
| diameter_requests_gx_retransmits | counter | | Total number of Gx retransmissions |
| diameter_requests_gy_retransmits | counter | | Total number of Gy retransmissions |
| diameter_requests_gx_errors_total | counter | code | Total number of Gx errors |
| diameter_requests_gy_errors_total | counter | code | Total number of Gy errors |
| diameter_requests_rar_total | counter | | Total number of RAR requests sent by TPOSS |
| diameter_rar_errors_total | counter | | Total number of failed RAR requests sent by TPOSS |
| diameter_requests_asr_total | counter | | Total number of ASR requests sent by TPOSS |
| diameter_asr_errors_total | counter | | Total number of failed ASR requests sent by TPOSS |
| diameter_requests_nasreq_total | counter | type | Total number of NASREQ requests received by TPOSS |
| diameter_nasreq_errors_total | counter | code | Total number of NASREQ errors |
| diameter_requests_rtt_milliseconds | histogram | le | Time needed to handle an incoming Diameter request, in milliseconds |
| diameter_if_requests_rtt_milliseconds | histogram | le, type | Time needed to handle an incoming Diameter request per Diameter interface, in milliseconds |

Look at these metrics when service sessions are not created or updated as expected. They show how many requests arrive, how many fail, and how long TPOSS needs to answer.

Each metric related to a Diameter response has the `code` label. This label specifies the value of the Diameter `Result-Code` AVP.

The `type` label specifies the type of a Diameter request. Each counter covers one Diameter interface, so its `type` value names only the request. The **diameter_if_requests_rtt_milliseconds** histogram covers every interface at once, so its `type` value names both the interface and the request.

In the table below you can see the difference:

| Request | `type` in the counters | `type` in diameter_if_requests_rtt_milliseconds |
|:---|:---|:---|
| Gx initial | `initial` | `gx_initial` |
| Gx update | `interim` | `gx_update` |
| Gx termination | `stop` | `gx_terminate` |
| Gy initial | `initial` | `gy_initial` |
| Gy update | `interim` | `gy_update` |
| Gy termination | `stop` | `gy_terminate` |
| NASREQ AAR | `aar` | `aar` |
| NASREQ Accounting-Start | `acr_start` | `acr_start` |
| NASREQ Accounting-Interim-Update | `acr_interim` | `acr_interim` |
| NASREQ Accounting-Stop | `acr_stop` | `acr_stop` |
| NASREQ Accounting-Event | `acr_event` | `acr_event` |
| NASREQ Session-Termination | `str` | `str` |
| S6a Authentication-Information | `air` | `s6a-air` |
| S6a Update-Location | `ulr` | `s6a-ulr` |
| S6a Purge-UE | `pur` | `s6a-pur` |
