Metrics
Kafka Gateway collects metrics for each protocol passing through it, plus a set of stream metrics for its internal message handler. To collect a metric, add its name to the telemetry.metrics property in your zilla.yaml config. The metrics can then be collected and exported via exporters, such as Prometheus.
HTTP
| Metric | Type | Description |
|---|---|---|
| http.active.requests | gauge | The number of active http requests. |
| http.duration | histogram | The duration of http requests in nanoseconds. |
| http.request.size | histogram | The http request content length in bytes. |
| http.response.size | histogram | The http response content length in bytes. |
telemetry:
metrics:
- http.active.requests
- http.duration
- http.request.size
- http.response.sizegRPC
| Metric | Type | Description |
|---|---|---|
| grpc.active.requests | gauge | The number of active grpc requests. |
| grpc.duration | histogram | The duration of grpc requests in nanoseconds. |
| grpc.request.size | histogram | The grpc request length in bytes. |
| grpc.response.size | histogram | The grpc response length in bytes. |
| grpc.requests.per.rpc | histogram | The number of grpc request messages per RPC. |
| grpc.responses.per.rpc | histogram | The number of grpc response messages per RPC. |
telemetry:
metrics:
- grpc.active.requests
- grpc.duration
- grpc.request.size
- grpc.response.size
- grpc.requests.per.rpc
- grpc.responses.per.rpcStream
Stream metrics relate to Kafka Gateway's internal message handler rather than a specific client-facing protocol.
| Metric | Type | Description |
|---|---|---|
| stream.active.received | gauge | The number of currently active received streams. |
| stream.active.sent | gauge | The number of currently active sent streams. |
| stream.opens.received | counter | The number of opened received streams. |
| stream.opens.sent | counter | The number of opened sent streams. |
| stream.data.received | counter | The count of bytes of data on received streams. |
| stream.data.sent | counter | The count of bytes of data on sent streams. |
| stream.errors.received | counter | The number of errors on received streams. |
| stream.errors.sent | counter | The number of errors on sent streams. |
| stream.closes.received | counter | The number of closed received streams. |
| stream.closes.sent | counter | The number of closed sent streams. |
telemetry:
metrics:
- stream.active.received
- stream.active.sent
- stream.opens.received
- stream.opens.sent
- stream.data.received
- stream.data.sent
- stream.errors.received
- stream.errors.sent
- stream.closes.received
- stream.closes.sentUse the zilla metrics command to see the raw metrics that Kafka Gateway has collected.

