Skip to content

Prometheus Metrics

GOST internally provides monitoring data through the Prometheus metrics.

Enable Metrics

gost -L :8080 -metrics=:9000
services:
- name: service-0
  addr: ":8080"
  handler:
    type: auto
  listener:
    type: tcp

metrics:
  addr: :9000
  path: /metrics
metrics.addr (string)
Metrics HTTP API service addresss
metrics.path (string, default=/metrics)
API path

Use the metrics option to enable metrics, which is disabled by default.

After enabling, you can view the metrics data through the http://localhost:9000/metrics endpoint.

Metrics

gost_chain_errors_total{chain="chain-0",host="host-0"} 1

gost_service_handler_errors_total{host="host-0",service="service-0"} 1

gost_service_request_duration_seconds_bucket{host="host-0",service="service-0",le="0.005"} 0
gost_service_request_duration_seconds_bucket{host="host-0",service="service-0",le="0.01"} 0
gost_service_request_duration_seconds_bucket{host="host-0",service="service-0",le="0.025"} 0
gost_service_request_duration_seconds_bucket{host="host-0",service="service-0",le="0.05"} 0
gost_service_request_duration_seconds_bucket{host="host-0",service="service-0",le="0.1"} 0
gost_service_request_duration_seconds_bucket{host="host-0",service="service-0",le="0.25"} 1
gost_service_request_duration_seconds_bucket{host="host-0",service="service-0",le="0.5"} 1
gost_service_request_duration_seconds_bucket{host="host-0",service="service-0",le="1"} 1
gost_service_request_duration_seconds_bucket{host="host-0",service="service-0",le="2.5"} 1
gost_service_request_duration_seconds_bucket{host="host-0",service="service-0",le="5"} 1
gost_service_request_duration_seconds_bucket{host="host-0",service="service-0",le="10"} 1
gost_service_request_duration_seconds_bucket{host="host-0",service="service-0",le="15"} 1
gost_service_request_duration_seconds_bucket{host="host-0",service="service-0",le="30"} 2
gost_service_request_duration_seconds_bucket{host="host-0",service="service-0",le="60"} 2
gost_service_request_duration_seconds_bucket{host="host-0",service="service-0",le="+Inf"} 2
gost_service_request_duration_seconds_sum{host="host-0",service="service-0"} 15.172895206
gost_service_request_duration_seconds_count{host="host-0",service="service-0"} 2

gost_service_requests_in_flight{host="host-0",service="service-0"} 0

gost_service_requests_total{host="host-0",service="service-0"} 2

gost_service_transfer_input_bytes_total{host="host-0",service="service-0"} 1018

gost_service_transfer_output_bytes_total{host="host-0",service="service-0"} 7327

gost_services{host="host-0"} 1

Metrics Description

gost_services (type=gauge)
Current number of services
gost_service_requests_total (type=counter)
Total number of requests
gost_service_transfer_input_bytes_total (type=counter)
Total service input data transfer size in bytes
gost_service_transfer_output_bytes_total (type=counter)
Total service output data transfer size in bytes
gost_service_requests_in_flight (type=gauge)
Current in-flight requests
gost_service_request_duration_seconds (type=histogram)
Distribution of request latencies
gost_service_handler_errors_total (type=counter)
Total service handler errors
gost_chain_errors_total (type=counter)
Total chain connection errors

Grafana Dashboard

You can use the following Dashboard to present metrics data.

https://grafana.com/grafana/dashboards/16037

GOST Dashboard