fix metrics
This commit is contained in:
parent
688455dd0b
commit
aeda8b11ca
@ -86,18 +86,18 @@ func (r *Route) connect(ctx context.Context) (conn net.Conn, err error) {
|
||||
return nil, ErrEmptyRoute
|
||||
}
|
||||
|
||||
network := "ip"
|
||||
node := r.nodes[0]
|
||||
|
||||
defer func() {
|
||||
if err != nil && r.chain != nil {
|
||||
if v := metrics.GetCounter(metrics.MetricChainErrorsCounter,
|
||||
metrics.Labels{"chain": r.chain.name}); v != nil {
|
||||
metrics.Labels{"chain": r.chain.name, "node": node.Name}); v != nil {
|
||||
v.Inc()
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
network := "ip"
|
||||
node := r.nodes[0]
|
||||
|
||||
addr, err := resolve(ctx, network, node.Addr, node.Resolver, node.Hosts, r.logger)
|
||||
if err != nil {
|
||||
node.Marker.Mark()
|
||||
|
@ -3,14 +3,23 @@ package metrics
|
||||
type MetricName string
|
||||
|
||||
const (
|
||||
// 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"
|
||||
// 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"
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user