fix metrics

This commit is contained in:
ginuerzh
2022-04-07 23:01:35 +08:00
parent 688455dd0b
commit aeda8b11ca
2 changed files with 21 additions and 12 deletions

View File

@ -3,15 +3,24 @@ package metrics
type MetricName string
const (
MetricServicesGauge MetricName = "gost_services"
MetricServiceRequestsCounter MetricName = "gost_service_requests_total"
MetricServiceRequestsInFlightGauge MetricName = "gost_service_requests_in_flight"
MetricServiceRequestsDurationObserver MetricName = "gost_service_request_duration_seconds"
MetricServiceTransferInputBytesCounter MetricName = "gost_service_transfer_input_bytes_total"
// Number of services. Labels: host.
MetricServicesGauge MetricName = "gost_services"
// Total service requests. Labels: host, service.
MetricServiceRequestsCounter MetricName = "gost_service_requests_total"
// Number of in-flight requests. Labels: host, service.
MetricServiceRequestsInFlightGauge MetricName = "gost_service_requests_in_flight"
// Request duration historgram. Labels: host, service.
MetricServiceRequestsDurationObserver MetricName = "gost_service_request_duration_seconds"
// Total service input data transfer size in bytes. Labels: host, service.
MetricServiceTransferInputBytesCounter MetricName = "gost_service_transfer_input_bytes_total"
// Total service output data transfer size in bytes. Labels: host, service.
MetricServiceTransferOutputBytesCounter MetricName = "gost_service_transfer_output_bytes_total"
MetricNodeConnectDurationObserver MetricName = "gost_chain_node_connect_duration_seconds"
MetricServiceHandlerErrorsCounter MetricName = "gost_service_handler_errors_total"
MetricChainErrorsCounter MetricName = "gost_chain_errors_total"
// Chain node connect duration histogram. Labels: host, chain, node.
MetricNodeConnectDurationObserver MetricName = "gost_chain_node_connect_duration_seconds"
// Total service handler errors. Labels: host, service.
MetricServiceHandlerErrorsCounter MetricName = "gost_service_handler_errors_total"
// Total chain connect errors. Labels: host, chain, node.
MetricChainErrorsCounter MetricName = "gost_chain_errors_total"
)
type Labels map[string]string