Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

etcdserver/api/v3rpc: add "etcd_network_server_stream_failures_total" #9760

Merged
merged 1 commit into from
May 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions etcdserver/api/v3rpc/lease.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ func (ls *LeaseServer) leaseKeepAlive(stream pb.Lease_LeaseKeepAliveServer) erro
} else {
plog.Warningf("failed to receive lease keepalive request from gRPC stream (%q)", err.Error())
}
streamFailures.WithLabelValues("receive", "lease-keepalive").Inc()
}
return err
}
Expand Down Expand Up @@ -160,6 +161,7 @@ func (ls *LeaseServer) leaseKeepAlive(stream pb.Lease_LeaseKeepAliveServer) erro
} else {
plog.Warningf("failed to send lease keepalive response to gRPC stream (%q)", err.Error())
}
streamFailures.WithLabelValues("send", "lease-keepalive").Inc()
}
return err
}
Expand Down
10 changes: 10 additions & 0 deletions etcdserver/api/v3rpc/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,19 @@ var (
Name: "client_grpc_received_bytes_total",
Help: "The total number of bytes received from grpc clients.",
})

streamFailures = prometheus.NewCounterVec(prometheus.CounterOpts{
Namespace: "etcd",
Subsystem: "network",
Name: "server_stream_failures_total",
Help: "The total number of stream failures from the local server.",
},
[]string{"Type", "API"},
)
)

func init() {
prometheus.MustRegister(sentBytes)
prometheus.MustRegister(receivedBytes)
prometheus.MustRegister(streamFailures)
}
4 changes: 4 additions & 0 deletions etcdserver/api/v3rpc/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ func (ws *watchServer) Watch(stream pb.Watch_WatchServer) (err error) {
} else {
plog.Warningf("failed to receive watch request from gRPC stream (%q)", rerr.Error())
}
streamFailures.WithLabelValues("receive", "watch").Inc()
}
errc <- rerr
}
Expand Down Expand Up @@ -416,6 +417,7 @@ func (sws *serverWatchStream) sendLoop() {
} else {
plog.Warningf("failed to send watch response to gRPC stream (%q)", serr.Error())
}
streamFailures.WithLabelValues("send", "watch").Inc()
}
return
}
Expand Down Expand Up @@ -445,6 +447,7 @@ func (sws *serverWatchStream) sendLoop() {
} else {
plog.Warningf("failed to send watch control response to gRPC stream (%q)", err.Error())
}
streamFailures.WithLabelValues("send", "watch").Inc()
}
return
}
Expand Down Expand Up @@ -473,6 +476,7 @@ func (sws *serverWatchStream) sendLoop() {
} else {
plog.Warningf("failed to send pending watch response to gRPC stream (%q)", err.Error())
}
streamFailures.WithLabelValues("send", "watch").Inc()
}
return
}
Expand Down