mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-05 20:11:14 +08:00
* fix: to start im or chat, ZooKeeper must be started first. * fix: msg gateway start output err info Signed-off-by: Gordon <1432970085@qq.com> * fix: msg gateway start output err info Signed-off-by: Gordon <1432970085@qq.com> * chore: package path changes Signed-off-by: withchao <993506633@qq.com> * fix: go mod update Signed-off-by: Gordon <1432970085@qq.com> * fix: token update Signed-off-by: Gordon <1432970085@qq.com> * chore: package path changes Signed-off-by: withchao <993506633@qq.com> * chore: package path changes Signed-off-by: withchao <993506633@qq.com> * fix: token update Signed-off-by: Gordon <1432970085@qq.com> * fix: token update Signed-off-by: Gordon <1432970085@qq.com> * fix: token update Signed-off-by: Gordon <1432970085@qq.com> * fix: token update Signed-off-by: Gordon <1432970085@qq.com> * fix: token update Signed-off-by: Gordon <1432970085@qq.com> * fix: token update Signed-off-by: Gordon <1432970085@qq.com> * fix: get all userID Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: msggateway add online status call Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * refactor: log change Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * refactor: log change Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * chore: network mode change Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * cicd: robot automated Change Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * cicd: robot automated Change Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * cicd: robot automated Change Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * feat: add api of get server time Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * feat: remove go work sum Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * cicd: robot automated Change Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix: pull message add isRead field Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: check msg-transfer script Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: script update Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: start don't kill old process Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * cicd: robot automated Change Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix: check component Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: pull message set isRead only message come from single. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * cicd: robot automated Change Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix: multiple gateway kick user each other. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: multiple gateway kick user each other. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: multiple gateway kick user each other. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: multiple gateway kick user each other. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: multiple gateway kick user each other. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: multiple gateway kick user each other. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * cicd: robot automated Change Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix: multiple gateway kick user each other. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: add ex field to update group info. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * cicd: robot automated Change * cicd: robot automated Change * refactor: change project module name. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * refactor: change project module name. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * refactor: change project module name. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * cicd: robot automated Change * test: for pressure test. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * test: for pressure test. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * test: for pressure test. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * test: message log. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * cicd: robot automated Change * fxi: component check output valid info. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fxi: component check output valid info. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * test: send message test log. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * cicd: robot automated Change * cicd: robot automated Change * test: remove info log. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * feat: api of send message add sendTime field. Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> * fix: add callback for update user's info. * cicd: robot automated Change * fix: change callback command name. * cicd: robot automated Change * fix: single chat unread status change. * fix: single chat unread status change. * fix: single chat unread status change. * fix: user status change. * cicd: robot automated Change * fix: user status change. * fix: user status change. * fix: user status change. * cicd: robot automated Change * fix: ws close when user logout. * fix: remove repeat platform on online status. * cicd: robot automated Change * fix: api send messages for notification conversation . * fix: api send messages for notification conversation . * fix: api send messages for notification conversation . * fix: api send messages for notification conversation . * fix: api send messages for notification conversation . * fix: api send messages for notification conversation. * fix: api send messages for notification conversation. * fix: api send messages for notification conversation. * fix: api send messages for notification conversation. * fix: api send messages for notification conversation. * fix: api send messages for notification conversation. * re: remove router of unsubscribeStatus. * re: remove router of unsubscribeStatus. * re: remove router of unsubscribeStatus. * re: remove router of unsubscribeStatus. * fix: reset branch * fix: not support redis cluster. CROSSSLOT Keys in request don't hash to the same slot * fix: update user.FaceURL do not trigger GroupMemberInfoSetNotification * cicd: robot automated Change * fix: api send messages for notification conversation. * fix: api send messages for notification conversation. --------- Signed-off-by: Gordon <1432970085@qq.com> Signed-off-by: withchao <993506633@qq.com> Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com> Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: withchao <993506633@qq.com> Co-authored-by: Xinwei Xiong <3293172751NSS@gmail.com> Co-authored-by: FGadvancer <FGadvancer@users.noreply.github.com> Co-authored-by: withchao <withchao@users.noreply.github.com>
471 lines
13 KiB
Go
471 lines
13 KiB
Go
// Copyright © 2023 OpenIM. All rights reserved.
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
package prome
|
|
|
|
import (
|
|
"github.com/prometheus/client_golang/prometheus"
|
|
"github.com/prometheus/client_golang/prometheus/promauto"
|
|
)
|
|
|
|
var (
|
|
// auth rpc.
|
|
UserLoginCounter prometheus.Counter
|
|
UserRegisterCounter prometheus.Counter
|
|
|
|
// seg.
|
|
SeqGetSuccessCounter prometheus.Counter
|
|
SeqGetFailedCounter prometheus.Counter
|
|
SeqSetSuccessCounter prometheus.Counter
|
|
SeqSetFailedCounter prometheus.Counter
|
|
|
|
// msg-db.
|
|
MsgInsertRedisSuccessCounter prometheus.Counter
|
|
MsgInsertRedisFailedCounter prometheus.Counter
|
|
MsgInsertMongoSuccessCounter prometheus.Counter
|
|
MsgInsertMongoFailedCounter prometheus.Counter
|
|
MsgPullFromRedisSuccessCounter prometheus.Counter
|
|
MsgPullFromRedisFailedCounter prometheus.Counter
|
|
MsgPullFromMongoSuccessCounter prometheus.Counter
|
|
MsgPullFromMongoFailedCounter prometheus.Counter
|
|
|
|
// msg-ws.
|
|
MsgRecvTotalCounter prometheus.Counter
|
|
GetNewestSeqTotalCounter prometheus.Counter
|
|
PullMsgBySeqListTotalCounter prometheus.Counter
|
|
|
|
SingleChatMsgRecvSuccessCounter prometheus.Counter
|
|
GroupChatMsgRecvSuccessCounter prometheus.Counter
|
|
WorkSuperGroupChatMsgRecvSuccessCounter prometheus.Counter
|
|
OnlineUserGauge prometheus.Gauge
|
|
|
|
// msg-msg.
|
|
SingleChatMsgProcessSuccessCounter prometheus.Counter
|
|
SingleChatMsgProcessFailedCounter prometheus.Counter
|
|
GroupChatMsgProcessSuccessCounter prometheus.Counter
|
|
GroupChatMsgProcessFailedCounter prometheus.Counter
|
|
WorkSuperGroupChatMsgProcessSuccessCounter prometheus.Counter
|
|
WorkSuperGroupChatMsgProcessFailedCounter prometheus.Counter
|
|
|
|
// msg-push.
|
|
MsgOnlinePushSuccessCounter prometheus.Counter
|
|
MsgOfflinePushSuccessCounter prometheus.Counter
|
|
MsgOfflinePushFailedCounter prometheus.Counter
|
|
// api.
|
|
ApiRequestCounter prometheus.Counter
|
|
ApiRequestSuccessCounter prometheus.Counter
|
|
ApiRequestFailedCounter prometheus.Counter
|
|
|
|
// grpc.
|
|
GrpcRequestCounter prometheus.Counter
|
|
GrpcRequestSuccessCounter prometheus.Counter
|
|
GrpcRequestFailedCounter prometheus.Counter
|
|
|
|
SendMsgCounter prometheus.Counter
|
|
|
|
// conversation.
|
|
ConversationCreateSuccessCounter prometheus.Counter
|
|
ConversationCreateFailedCounter prometheus.Counter
|
|
)
|
|
|
|
func NewUserLoginCounter() {
|
|
if UserLoginCounter != nil {
|
|
return
|
|
}
|
|
UserLoginCounter = promauto.NewCounter(prometheus.CounterOpts{
|
|
Name: "user_login",
|
|
Help: "The number of user login",
|
|
})
|
|
}
|
|
|
|
func NewUserRegisterCounter() {
|
|
if UserRegisterCounter != nil {
|
|
return
|
|
}
|
|
UserRegisterCounter = promauto.NewCounter(prometheus.CounterOpts{
|
|
Name: "user_register",
|
|
Help: "The number of user register",
|
|
})
|
|
}
|
|
|
|
func NewSeqGetSuccessCounter() {
|
|
if SeqGetSuccessCounter != nil {
|
|
return
|
|
}
|
|
SeqGetSuccessCounter = promauto.NewCounter(prometheus.CounterOpts{
|
|
Name: "seq_get_success",
|
|
Help: "The number of successful get seq",
|
|
})
|
|
}
|
|
|
|
func NewSeqGetFailedCounter() {
|
|
if SeqGetFailedCounter != nil {
|
|
return
|
|
}
|
|
SeqGetFailedCounter = promauto.NewCounter(prometheus.CounterOpts{
|
|
Name: "seq_get_failed",
|
|
Help: "The number of failed get seq",
|
|
})
|
|
}
|
|
|
|
func NewSeqSetSuccessCounter() {
|
|
if SeqSetSuccessCounter != nil {
|
|
return
|
|
}
|
|
SeqSetSuccessCounter = promauto.NewCounter(prometheus.CounterOpts{
|
|
Name: "seq_set_success",
|
|
Help: "The number of successful set seq",
|
|
})
|
|
}
|
|
|
|
func NewSeqSetFailedCounter() {
|
|
if SeqSetFailedCounter != nil {
|
|
return
|
|
}
|
|
SeqSetFailedCounter = promauto.NewCounter(prometheus.CounterOpts{
|
|
Name: "seq_set_failed",
|
|
Help: "The number of failed set seq",
|
|
})
|
|
}
|
|
|
|
func NewApiRequestCounter() {
|
|
if ApiRequestCounter != nil {
|
|
return
|
|
}
|
|
ApiRequestCounter = promauto.NewCounter(prometheus.CounterOpts{
|
|
Name: "api_request",
|
|
Help: "The number of api request",
|
|
})
|
|
}
|
|
|
|
func NewApiRequestSuccessCounter() {
|
|
if ApiRequestSuccessCounter != nil {
|
|
return
|
|
}
|
|
ApiRequestSuccessCounter = promauto.NewCounter(prometheus.CounterOpts{
|
|
Name: "api_request_success",
|
|
Help: "The number of api request success",
|
|
})
|
|
}
|
|
|
|
func NewApiRequestFailedCounter() {
|
|
if ApiRequestFailedCounter != nil {
|
|
return
|
|
}
|
|
ApiRequestFailedCounter = promauto.NewCounter(prometheus.CounterOpts{
|
|
Name: "api_request_failed",
|
|
Help: "The number of api request failed",
|
|
})
|
|
}
|
|
|
|
func NewGrpcRequestCounter() {
|
|
if GrpcRequestCounter != nil {
|
|
return
|
|
}
|
|
GrpcRequestCounter = promauto.NewCounter(prometheus.CounterOpts{
|
|
Name: "grpc_request",
|
|
Help: "The number of api request",
|
|
})
|
|
}
|
|
|
|
func NewGrpcRequestSuccessCounter() {
|
|
if GrpcRequestSuccessCounter != nil {
|
|
return
|
|
}
|
|
GrpcRequestSuccessCounter = promauto.NewCounter(prometheus.CounterOpts{
|
|
Name: "grpc_request_success",
|
|
Help: "The number of grpc request success",
|
|
})
|
|
}
|
|
|
|
func NewGrpcRequestFailedCounter() {
|
|
if GrpcRequestFailedCounter != nil {
|
|
return
|
|
}
|
|
GrpcRequestFailedCounter = promauto.NewCounter(prometheus.CounterOpts{
|
|
Name: "grpc_request_failed",
|
|
Help: "The number of grpc request failed",
|
|
})
|
|
}
|
|
|
|
func NewSendMsgCount() {
|
|
if SendMsgCounter != nil {
|
|
return
|
|
}
|
|
SendMsgCounter = promauto.NewCounter(prometheus.CounterOpts{
|
|
Name: "send_msg",
|
|
Help: "The number of send msg",
|
|
})
|
|
}
|
|
|
|
func NewMsgInsertRedisSuccessCounter() {
|
|
if MsgInsertRedisSuccessCounter != nil {
|
|
return
|
|
}
|
|
MsgInsertRedisSuccessCounter = promauto.NewCounter(prometheus.CounterOpts{
|
|
Name: "msg_insert_redis_success",
|
|
Help: "The number of successful insert msg to redis",
|
|
})
|
|
}
|
|
|
|
func NewMsgInsertRedisFailedCounter() {
|
|
if MsgInsertRedisFailedCounter != nil {
|
|
return
|
|
}
|
|
MsgInsertRedisFailedCounter = promauto.NewCounter(prometheus.CounterOpts{
|
|
Name: "msg_insert_redis_failed",
|
|
Help: "The number of failed insert msg to redis",
|
|
})
|
|
}
|
|
|
|
func NewMsgInsertMongoSuccessCounter() {
|
|
if MsgInsertMongoSuccessCounter != nil {
|
|
return
|
|
}
|
|
MsgInsertMongoSuccessCounter = promauto.NewCounter(prometheus.CounterOpts{
|
|
Name: "msg_insert_mongo_success",
|
|
Help: "The number of successful insert msg to mongo",
|
|
})
|
|
}
|
|
|
|
func NewMsgInsertMongoFailedCounter() {
|
|
if MsgInsertMongoFailedCounter != nil {
|
|
return
|
|
}
|
|
MsgInsertMongoFailedCounter = promauto.NewCounter(prometheus.CounterOpts{
|
|
Name: "msg_insert_mongo_failed",
|
|
Help: "The number of failed insert msg to mongo",
|
|
})
|
|
}
|
|
|
|
func NewMsgPullFromRedisSuccessCounter() {
|
|
if MsgPullFromRedisSuccessCounter != nil {
|
|
return
|
|
}
|
|
MsgPullFromRedisSuccessCounter = promauto.NewCounter(prometheus.CounterOpts{
|
|
Name: "msg_pull_from_redis_success",
|
|
Help: "The number of successful pull msg from redis",
|
|
})
|
|
}
|
|
|
|
func NewMsgPullFromRedisFailedCounter() {
|
|
if MsgPullFromRedisFailedCounter != nil {
|
|
return
|
|
}
|
|
MsgPullFromRedisFailedCounter = promauto.NewCounter(prometheus.CounterOpts{
|
|
Name: "msg_pull_from_redis_failed",
|
|
Help: "The number of failed pull msg from redis",
|
|
})
|
|
}
|
|
|
|
func NewMsgPullFromMongoSuccessCounter() {
|
|
if MsgPullFromMongoSuccessCounter != nil {
|
|
return
|
|
}
|
|
MsgPullFromMongoSuccessCounter = promauto.NewCounter(prometheus.CounterOpts{
|
|
Name: "msg_pull_from_mongo_success",
|
|
Help: "The number of successful pull msg from mongo",
|
|
})
|
|
}
|
|
|
|
func NewMsgPullFromMongoFailedCounter() {
|
|
if MsgPullFromMongoFailedCounter != nil {
|
|
return
|
|
}
|
|
MsgPullFromMongoFailedCounter = promauto.NewCounter(prometheus.CounterOpts{
|
|
Name: "msg_pull_from_mongo_failed",
|
|
Help: "The number of failed pull msg from mongo",
|
|
})
|
|
}
|
|
|
|
func NewMsgRecvTotalCounter() {
|
|
if MsgRecvTotalCounter != nil {
|
|
return
|
|
}
|
|
MsgRecvTotalCounter = promauto.NewCounter(prometheus.CounterOpts{
|
|
Name: "msg_recv_total",
|
|
Help: "The number of msg received",
|
|
})
|
|
}
|
|
|
|
func NewGetNewestSeqTotalCounter() {
|
|
if GetNewestSeqTotalCounter != nil {
|
|
return
|
|
}
|
|
GetNewestSeqTotalCounter = promauto.NewCounter(prometheus.CounterOpts{
|
|
Name: "get_newest_seq_total",
|
|
Help: "the number of get newest seq",
|
|
})
|
|
}
|
|
|
|
func NewPullMsgBySeqListTotalCounter() {
|
|
if PullMsgBySeqListTotalCounter != nil {
|
|
return
|
|
}
|
|
PullMsgBySeqListTotalCounter = promauto.NewCounter(prometheus.CounterOpts{
|
|
Name: "pull_msg_by_seq_list_total",
|
|
Help: "The number of pull msg by seq list",
|
|
})
|
|
}
|
|
|
|
func NewSingleChatMsgRecvSuccessCounter() {
|
|
if SingleChatMsgRecvSuccessCounter != nil {
|
|
return
|
|
}
|
|
SingleChatMsgRecvSuccessCounter = promauto.NewCounter(prometheus.CounterOpts{
|
|
Name: "single_chat_msg_recv_success",
|
|
Help: "The number of single chat msg successful received ",
|
|
})
|
|
}
|
|
|
|
func NewGroupChatMsgRecvSuccessCounter() {
|
|
if GroupChatMsgRecvSuccessCounter != nil {
|
|
return
|
|
}
|
|
GroupChatMsgRecvSuccessCounter = promauto.NewCounter(prometheus.CounterOpts{
|
|
Name: "group_chat_msg_recv_success",
|
|
Help: "The number of group chat msg successful received",
|
|
})
|
|
}
|
|
|
|
func NewWorkSuperGroupChatMsgRecvSuccessCounter() {
|
|
if WorkSuperGroupChatMsgRecvSuccessCounter != nil {
|
|
return
|
|
}
|
|
WorkSuperGroupChatMsgRecvSuccessCounter = promauto.NewCounter(prometheus.CounterOpts{
|
|
Name: "work_super_group_chat_msg_recv_success",
|
|
Help: "The number of work/super group chat msg successful received",
|
|
})
|
|
}
|
|
|
|
func NewOnlineUserGauges() {
|
|
if OnlineUserGauge != nil {
|
|
return
|
|
}
|
|
OnlineUserGauge = promauto.NewGauge(prometheus.GaugeOpts{
|
|
Name: "online_user_num",
|
|
Help: "The number of online user num",
|
|
})
|
|
}
|
|
|
|
func NewSingleChatMsgProcessSuccessCounter() {
|
|
if SingleChatMsgProcessSuccessCounter != nil {
|
|
return
|
|
}
|
|
SingleChatMsgProcessSuccessCounter = promauto.NewCounter(prometheus.CounterOpts{
|
|
Name: "single_chat_msg_process_success",
|
|
Help: "The number of single chat msg successful processed",
|
|
})
|
|
}
|
|
|
|
func NewSingleChatMsgProcessFailedCounter() {
|
|
if SingleChatMsgProcessFailedCounter != nil {
|
|
return
|
|
}
|
|
SingleChatMsgProcessFailedCounter = promauto.NewCounter(prometheus.CounterOpts{
|
|
Name: "single_chat_msg_process_failed",
|
|
Help: "The number of single chat msg failed processed",
|
|
})
|
|
}
|
|
|
|
func NewGroupChatMsgProcessSuccessCounter() {
|
|
if GroupChatMsgProcessSuccessCounter != nil {
|
|
return
|
|
}
|
|
GroupChatMsgProcessSuccessCounter = promauto.NewCounter(prometheus.CounterOpts{
|
|
Name: "group_chat_msg_process_success",
|
|
Help: "The number of group chat msg successful processed",
|
|
})
|
|
}
|
|
|
|
func NewGroupChatMsgProcessFailedCounter() {
|
|
if GroupChatMsgProcessFailedCounter != nil {
|
|
return
|
|
}
|
|
GroupChatMsgProcessFailedCounter = promauto.NewCounter(prometheus.CounterOpts{
|
|
Name: "group_chat_msg_process_failed",
|
|
Help: "The number of group chat msg failed processed",
|
|
})
|
|
}
|
|
|
|
func NewWorkSuperGroupChatMsgProcessSuccessCounter() {
|
|
if WorkSuperGroupChatMsgProcessSuccessCounter != nil {
|
|
return
|
|
}
|
|
WorkSuperGroupChatMsgProcessSuccessCounter = promauto.NewCounter(prometheus.CounterOpts{
|
|
Name: "work_super_group_chat_msg_process_success",
|
|
Help: "The number of work/super group chat msg successful processed",
|
|
})
|
|
}
|
|
|
|
func NewWorkSuperGroupChatMsgProcessFailedCounter() {
|
|
if WorkSuperGroupChatMsgProcessFailedCounter != nil {
|
|
return
|
|
}
|
|
WorkSuperGroupChatMsgProcessFailedCounter = promauto.NewCounter(prometheus.CounterOpts{
|
|
Name: "work_super_group_chat_msg_process_failed",
|
|
Help: "The number of work/super group chat msg failed processed",
|
|
})
|
|
}
|
|
|
|
func NewMsgOnlinePushSuccessCounter() {
|
|
if MsgOnlinePushSuccessCounter != nil {
|
|
return
|
|
}
|
|
MsgOnlinePushSuccessCounter = promauto.NewCounter(prometheus.CounterOpts{
|
|
Name: "msg_online_push_success",
|
|
Help: "The number of msg successful online pushed",
|
|
})
|
|
}
|
|
|
|
func NewMsgOfflinePushSuccessCounter() {
|
|
if MsgOfflinePushSuccessCounter != nil {
|
|
return
|
|
}
|
|
MsgOfflinePushSuccessCounter = promauto.NewCounter(prometheus.CounterOpts{
|
|
Name: "msg_offline_push_success",
|
|
Help: "The number of msg successful offline pushed",
|
|
})
|
|
}
|
|
|
|
func NewMsgOfflinePushFailedCounter() {
|
|
if MsgOfflinePushFailedCounter != nil {
|
|
return
|
|
}
|
|
MsgOfflinePushFailedCounter = promauto.NewCounter(prometheus.CounterOpts{
|
|
Name: "msg_offline_push_failed",
|
|
Help: "The number of msg failed offline pushed",
|
|
})
|
|
}
|
|
|
|
func NewConversationCreateSuccessCounter() {
|
|
if ConversationCreateSuccessCounter != nil {
|
|
return
|
|
}
|
|
ConversationCreateSuccessCounter = promauto.NewCounter(prometheus.CounterOpts{
|
|
Name: "conversation_push_success",
|
|
Help: "The number of conversation successful pushed",
|
|
})
|
|
}
|
|
|
|
func NewConversationCreateFailedCounter() {
|
|
if ConversationCreateFailedCounter != nil {
|
|
return
|
|
}
|
|
ConversationCreateFailedCounter = promauto.NewCounter(prometheus.CounterOpts{
|
|
Name: "conversation_push_failed",
|
|
Help: "The number of conversation failed pushed",
|
|
})
|
|
}
|