parent
78b0181238
commit
9b2c8244f7
@ -0,0 +1,47 @@
|
|||||||
|
# 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.
|
||||||
|
|
||||||
|
###################### AlertManager Configuration ######################
|
||||||
|
# AlertManager configuration using environment variables
|
||||||
|
#
|
||||||
|
# Resolve timeout
|
||||||
|
# SMTP configuration for sending alerts
|
||||||
|
# Templates for email notifications
|
||||||
|
# Routing configurations for alerts
|
||||||
|
# Receiver configurations
|
||||||
|
global:
|
||||||
|
resolve_timeout: 5m
|
||||||
|
smtp_from: alert@openim.io
|
||||||
|
smtp_smarthost: smtp.163.com:465
|
||||||
|
smtp_auth_username: alert@openim.io
|
||||||
|
smtp_auth_password: YOURAUTHPASSWORD
|
||||||
|
smtp_require_tls: false
|
||||||
|
smtp_hello: xxx监控告警
|
||||||
|
|
||||||
|
templates:
|
||||||
|
- /etc/alertmanager/email.tmpl
|
||||||
|
|
||||||
|
route:
|
||||||
|
group_by: ['alertname']
|
||||||
|
group_wait: 5s
|
||||||
|
group_interval: 5s
|
||||||
|
repeat_interval: 5m
|
||||||
|
receiver: email
|
||||||
|
receivers:
|
||||||
|
- name: email
|
||||||
|
email_configs:
|
||||||
|
- to: 'alert@example.com'
|
||||||
|
html: '{{ template "email.to.html" . }}'
|
||||||
|
headers: { Subject: "[OPENIM-SERVER]Alarm" }
|
||||||
|
send_resolved: true
|
@ -0,0 +1,529 @@
|
|||||||
|
# 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.
|
||||||
|
|
||||||
|
# -----------------------------------------------------------------
|
||||||
|
# TODO: This config file is the template file
|
||||||
|
# --| source: deployments/templates/config.yaml
|
||||||
|
# --| env: scripts/install/environment
|
||||||
|
# --| target: config/config.yaml
|
||||||
|
# -----------------------------------------------------------------
|
||||||
|
|
||||||
|
envs:
|
||||||
|
discovery: zookeeper
|
||||||
|
|
||||||
|
###################### Zookeeper ######################
|
||||||
|
# Zookeeper configuration
|
||||||
|
# It's not recommended to modify the schema
|
||||||
|
#
|
||||||
|
# Zookeeper address
|
||||||
|
# Zookeeper username
|
||||||
|
# Zookeeper password
|
||||||
|
zookeeper:
|
||||||
|
schema: openim
|
||||||
|
address: [ 172.28.0.1:12181 ]
|
||||||
|
username: ''
|
||||||
|
password: ''
|
||||||
|
|
||||||
|
###################### Mongo ######################
|
||||||
|
# MongoDB configuration
|
||||||
|
|
||||||
|
# If uri is not empty, it will be used directly for the MongoDB connection.
|
||||||
|
# This is a complete MongoDB URI string.
|
||||||
|
# Example: mongodb://user:password@host1:port1,host2:port2/dbname?options
|
||||||
|
mongo:
|
||||||
|
uri: ''
|
||||||
|
|
||||||
|
# List of MongoDB server addresses.
|
||||||
|
# Used for constructing the MongoDB URI if 'uri' above is empty.
|
||||||
|
# For a standalone setup, specify the address of the single server.
|
||||||
|
# For a sharded cluster, specify the addresses of the Mongos servers.
|
||||||
|
# Example: [ '172.28.0.1:37017', '172.28.0.2:37017' ]
|
||||||
|
# Default MongoDB database name
|
||||||
|
# Maximum connection pool size
|
||||||
|
address: [ 172.28.0.1:37017 ]
|
||||||
|
database: openim_v3
|
||||||
|
username: openIM
|
||||||
|
password: openIM123
|
||||||
|
maxPoolSize: 100
|
||||||
|
|
||||||
|
###################### Redis configuration information ######################
|
||||||
|
# Redis configuration
|
||||||
|
#
|
||||||
|
# Username is required only for Redis version 6.0+
|
||||||
|
redis:
|
||||||
|
address: [ 172.28.0.1:16379 ]
|
||||||
|
username: ''
|
||||||
|
password: openIM123
|
||||||
|
|
||||||
|
###################### Kafka configuration information ######################
|
||||||
|
# Kafka configuration
|
||||||
|
#
|
||||||
|
# Kafka username
|
||||||
|
# Kafka password
|
||||||
|
# It's not recommended to modify this topic name
|
||||||
|
# Consumer group ID, it's not recommended to modify
|
||||||
|
kafka:
|
||||||
|
username: ''
|
||||||
|
password: ''
|
||||||
|
addr: [ 172.28.0.1:19094 ]
|
||||||
|
latestMsgToRedis:
|
||||||
|
topic: "latestMsgToRedis"
|
||||||
|
offlineMsgToMongo:
|
||||||
|
topic: "offlineMsgToMongoMysql"
|
||||||
|
msgToPush:
|
||||||
|
topic: "msgToPush"
|
||||||
|
consumerGroupID:
|
||||||
|
msgToRedis: redis
|
||||||
|
msgToMongo: mongo
|
||||||
|
msgToMySql: mysql
|
||||||
|
msgToPush: push
|
||||||
|
|
||||||
|
###################### RPC configuration information ######################
|
||||||
|
# RPC configuration
|
||||||
|
#
|
||||||
|
# IP address to register with zookeeper when starting RPC, the IP and corresponding rpcPort should be accessible by api/gateway
|
||||||
|
# Default listen IP is 0.0.0.0
|
||||||
|
rpc:
|
||||||
|
registerIP: ''
|
||||||
|
listenIP: 0.0.0.0
|
||||||
|
|
||||||
|
###################### API configuration information ######################
|
||||||
|
# API configuration
|
||||||
|
#
|
||||||
|
# API service port
|
||||||
|
# Default listen IP is 0.0.0.0
|
||||||
|
api:
|
||||||
|
openImApiPort: [ 10002 ]
|
||||||
|
listenIP: 0.0.0.0
|
||||||
|
|
||||||
|
###################### Object configuration information ######################
|
||||||
|
# Object storage configuration
|
||||||
|
#
|
||||||
|
# Use minio for object storage
|
||||||
|
# API URL should be accessible by the app
|
||||||
|
# It's not recommended to modify the bucket name
|
||||||
|
# Endpoint should be accessible by the app
|
||||||
|
# Session token
|
||||||
|
# Configuration for Tencent COS
|
||||||
|
# Configuration for Aliyun OSS
|
||||||
|
# apiURL is the address of the api, the access address of the app, use s3 must be configured
|
||||||
|
# minio.endpoint can be configured as an intranet address,
|
||||||
|
# minio.signEndpoint is minio public network address
|
||||||
|
object:
|
||||||
|
enable: "minio"
|
||||||
|
apiURL: "http://172.28.0.1:10002"
|
||||||
|
minio:
|
||||||
|
bucket: "openim"
|
||||||
|
endpoint: "http://172.28.0.1:10005"
|
||||||
|
accessKeyID: "root"
|
||||||
|
secretAccessKey: "openIM123"
|
||||||
|
sessionToken: ''
|
||||||
|
signEndpoint: "http://172.28.0.1:10005"
|
||||||
|
publicRead: false
|
||||||
|
cos:
|
||||||
|
bucketURL: https://temp-1252357374.cos.ap-chengdu.myqcloud.com
|
||||||
|
secretID: ''
|
||||||
|
secretKey: ''
|
||||||
|
sessionToken: ''
|
||||||
|
publicRead: false
|
||||||
|
oss:
|
||||||
|
endpoint: "https://oss-cn-chengdu.aliyuncs.com"
|
||||||
|
bucket: "demo-9999999"
|
||||||
|
bucketURL: "https://demo-9999999.oss-cn-chengdu.aliyuncs.com"
|
||||||
|
accessKeyID: ''
|
||||||
|
accessKeySecret: ''
|
||||||
|
sessionToken: ''
|
||||||
|
publicRead: false
|
||||||
|
kodo:
|
||||||
|
endpoint: "http://s3.cn-east-1.qiniucs.com"
|
||||||
|
bucket: "demo-9999999"
|
||||||
|
bucketURL: "http://your.domain.com"
|
||||||
|
accessKeyID: ''
|
||||||
|
accessKeySecret: ''
|
||||||
|
sessionToken: ''
|
||||||
|
publicRead: false
|
||||||
|
|
||||||
|
###################### RPC Port Configuration ######################
|
||||||
|
# RPC service ports
|
||||||
|
# These ports are passed into the program by the script and are not recommended to modify
|
||||||
|
# For launching multiple programs, just fill in multiple ports separated by commas
|
||||||
|
# For example, [10110, 10111]
|
||||||
|
rpcPort:
|
||||||
|
openImUserPort: [ 10110 ]
|
||||||
|
openImFriendPort: [ 10120 ]
|
||||||
|
openImMessagePort: [ 10130 ]
|
||||||
|
openImGroupPort: [ 10150 ]
|
||||||
|
openImAuthPort: [ 10160 ]
|
||||||
|
openImPushPort: [ 10170 ]
|
||||||
|
openImConversationPort: [ 10180 ]
|
||||||
|
openImThirdPort: [ 10190 ]
|
||||||
|
|
||||||
|
###################### RPC Register Name Configuration ######################
|
||||||
|
# RPC service names for registration, it's not recommended to modify these
|
||||||
|
rpcRegisterName:
|
||||||
|
openImUserName: User
|
||||||
|
openImFriendName: Friend
|
||||||
|
openImMsgName: Msg
|
||||||
|
openImPushName: Push
|
||||||
|
openImMessageGatewayName: MessageGateway
|
||||||
|
openImGroupName: Group
|
||||||
|
openImAuthName: Auth
|
||||||
|
openImConversationName: Conversation
|
||||||
|
openImThirdName: Third
|
||||||
|
|
||||||
|
###################### Log Configuration ######################
|
||||||
|
# Log configuration
|
||||||
|
#
|
||||||
|
# Storage directory
|
||||||
|
# Log rotation time
|
||||||
|
# Maximum number of logs to retain
|
||||||
|
# Log level, 6 means all levels
|
||||||
|
# Whether to output to stdout
|
||||||
|
# Whether to output in json format
|
||||||
|
# Whether to include stack trace in logs
|
||||||
|
log:
|
||||||
|
storageLocation: /workspaces/open-im-server/logs/
|
||||||
|
rotationTime: 24
|
||||||
|
remainRotationCount: 2
|
||||||
|
remainLogLevel: 6
|
||||||
|
isStdout: false
|
||||||
|
isJson: false
|
||||||
|
withStack: false
|
||||||
|
|
||||||
|
###################### Variables definition ######################
|
||||||
|
# Long connection server configuration
|
||||||
|
#
|
||||||
|
# Websocket port for msg_gateway
|
||||||
|
# Maximum number of websocket connections
|
||||||
|
# Maximum length of websocket request package
|
||||||
|
# Websocket connection handshake timeout
|
||||||
|
longConnSvr:
|
||||||
|
openImWsPort: [ 10001 ]
|
||||||
|
websocketMaxConnNum: 100000
|
||||||
|
openImMessageGatewayPort: [ 10140 ]
|
||||||
|
websocketMaxMsgLen: 4096
|
||||||
|
websocketTimeout: 10
|
||||||
|
|
||||||
|
# Push notification service configuration
|
||||||
|
#
|
||||||
|
# Use GeTui for push notifications
|
||||||
|
# GeTui offline push configuration
|
||||||
|
# FCM offline push configuration
|
||||||
|
# Account file, place it in the config directory
|
||||||
|
# JPush configuration, modify these after applying in JPush backend
|
||||||
|
push:
|
||||||
|
enable: getui
|
||||||
|
geTui:
|
||||||
|
pushUrl: "https://restapi.getui.com/v2/$appId"
|
||||||
|
masterSecret: ''
|
||||||
|
appKey: ''
|
||||||
|
intent: ''
|
||||||
|
channelID: ''
|
||||||
|
channelName: ''
|
||||||
|
fcm:
|
||||||
|
serviceAccount: "x.json"
|
||||||
|
jpns:
|
||||||
|
appKey: ''
|
||||||
|
masterSecret: ''
|
||||||
|
pushUrl: ''
|
||||||
|
pushIntent: ''
|
||||||
|
|
||||||
|
# App manager configuration
|
||||||
|
#
|
||||||
|
# Built-in app manager user IDs
|
||||||
|
# Built-in app manager nicknames
|
||||||
|
manager:
|
||||||
|
userID: [ "openIM123456", "openIM654321", "openIMAdmin" ]
|
||||||
|
nickname: [ "system1", "system2", "system3" ]
|
||||||
|
|
||||||
|
# chatAdmin, use for send notification
|
||||||
|
#
|
||||||
|
# Built-in app system notification account ID
|
||||||
|
# Built-in app system notification account nickname
|
||||||
|
im-admin:
|
||||||
|
userID: [ "imAdmin" ]
|
||||||
|
nickname: [ "imAdmin" ]
|
||||||
|
|
||||||
|
# Multi-platform login policy
|
||||||
|
# For each platform(Android, iOS, Windows, Mac, web), only one can be online at a time
|
||||||
|
multiLoginPolicy: 1
|
||||||
|
|
||||||
|
# Whether to store messages in MySQL, messages in MySQL are only used for management background
|
||||||
|
chatPersistenceMysql: true
|
||||||
|
|
||||||
|
# Message cache timeout in seconds, it's not recommended to modify
|
||||||
|
msgCacheTimeout: 86400
|
||||||
|
|
||||||
|
# Whether to enable read receipts for group chat
|
||||||
|
groupMessageHasReadReceiptEnable: true
|
||||||
|
|
||||||
|
# Whether to enable read receipts for single chat
|
||||||
|
singleMessageHasReadReceiptEnable: true
|
||||||
|
|
||||||
|
# MongoDB offline message retention period in days
|
||||||
|
retainChatRecords: 365
|
||||||
|
|
||||||
|
# Schedule to clear expired messages(older than retainChatRecords days) in MongoDB every Wednesday at 2am
|
||||||
|
# This deletion is just for cleaning up disk usage according to previous configuration retainChatRecords, no notification will be sent
|
||||||
|
chatRecordsClearTime: "0 2 * * 3"
|
||||||
|
|
||||||
|
# Schedule to auto delete messages every day at 2am
|
||||||
|
# This deletion is for messages that have been retained for more than msg_destruct_time (seconds) in the conversation field
|
||||||
|
msgDestructTime: "0 2 * * *"
|
||||||
|
|
||||||
|
# Secret key
|
||||||
|
secret: openIM123
|
||||||
|
|
||||||
|
# Token policy
|
||||||
|
#
|
||||||
|
# Token expiration period in days
|
||||||
|
tokenPolicy:
|
||||||
|
expire: 90
|
||||||
|
|
||||||
|
# Message verification policy
|
||||||
|
#
|
||||||
|
# Whether to verify friendship when sending messages
|
||||||
|
messageVerify:
|
||||||
|
friendVerify: false
|
||||||
|
|
||||||
|
# iOS push notification configuration
|
||||||
|
#
|
||||||
|
# iOS push notification sound
|
||||||
|
# Whether to count badge
|
||||||
|
# Whether it's production environment
|
||||||
|
iosPush:
|
||||||
|
pushSound: "xxx"
|
||||||
|
badgeCount: true
|
||||||
|
production: false
|
||||||
|
|
||||||
|
###################### Third-party service configuration ######################
|
||||||
|
# Callback configuration
|
||||||
|
#
|
||||||
|
# Callback URL
|
||||||
|
# Whether to enable this callback event
|
||||||
|
# Timeout in seconds
|
||||||
|
# Whether to continue execution if callback fails
|
||||||
|
callback:
|
||||||
|
url: "http://127.0.0.1:10008/callbackExample"
|
||||||
|
beforeSendSingleMsg:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
beforeUpdateUserInfoEx:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
afterUpdateUserInfoEx:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
afterSendSingleMsg:
|
||||||
|
enable: true
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
beforeSendGroupMsg:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
afterSendGroupMsg:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
msgModify:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
userOnline:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
userOffline:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
userKickOff:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
offlinePush:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
onlinePush:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
superGroupOnlinePush:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
beforeAddFriend:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
beforeUpdateUserInfo:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
beforeCreateGroup:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
afterCreateGroup:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
beforeMemberJoinGroup:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
beforeSetGroupMemberInfo:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
afterSetGroupMemberInfo:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
setMessageReactionExtensions:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
quitGroup:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
killGroupMember:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
dismissGroup:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
joinGroup:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
groupMsgRead:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
singleMsgRead:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
updateUserInfo:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
beforeUserRegister:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
afterUserRegister:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
transferGroupOwner:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
beforeSetFriendRemark:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
afterSetFriendRemark:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
afterGroupMsgRead:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
afterGroupMsgRevoke:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
afterJoinGroup:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
beforeInviteUserToGroup:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
joinGroupAfter:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
setGroupInfoAfter:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
setGroupInfoBefore:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
revokeMsgAfter:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
addBlackBefore:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
addFriendAfter:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
addFriendAgreeBefore:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
deleteFriendAfter:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
importFriendsBefore:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
importFriendsAfter:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
removeBlackAfter:
|
||||||
|
enable: false
|
||||||
|
timeout: 5
|
||||||
|
failedContinue: true
|
||||||
|
###################### Prometheus ######################
|
||||||
|
# Prometheus configuration for various services
|
||||||
|
# The number of Prometheus ports per service needs to correspond to rpcPort
|
||||||
|
# The number of ports needs to be consistent with msg_transfer_service_num in script/path_info.sh
|
||||||
|
prometheus:
|
||||||
|
enable: true
|
||||||
|
grafanaUrl: http://172.28.0.1:13000/
|
||||||
|
apiPrometheusPort: [20100]
|
||||||
|
userPrometheusPort: [ 20110 ]
|
||||||
|
friendPrometheusPort: [ 20120 ]
|
||||||
|
messagePrometheusPort: [ 20130 ]
|
||||||
|
messageGatewayPrometheusPort: [ 20140 ]
|
||||||
|
groupPrometheusPort: [ 20150 ]
|
||||||
|
authPrometheusPort: [ 20160 ]
|
||||||
|
pushPrometheusPort: [ 20170 ]
|
||||||
|
conversationPrometheusPort: [ 20230 ]
|
||||||
|
rtcPrometheusPort: [ 21300 ]
|
||||||
|
thirdPrometheusPort: [ 21301 ]
|
||||||
|
messageTransferPrometheusPort: [ 21400, 21401, 21402, 21403 ] # List of ports
|
@ -0,0 +1,16 @@
|
|||||||
|
{{ define "email.to.html" }}
|
||||||
|
{{ range .Alerts }}
|
||||||
|
<!-- Begin of OpenIM Alert -->
|
||||||
|
<div style="border:1px solid #ccc; padding:10px; margin-bottom:10px;">
|
||||||
|
<h3>OpenIM Alert</h3>
|
||||||
|
<p><strong>Alert Program:</strong> Prometheus Alert</p>
|
||||||
|
<p><strong>Severity Level:</strong> {{ .Labels.severity }}</p>
|
||||||
|
<p><strong>Alert Type:</strong> {{ .Labels.alertname }}</p>
|
||||||
|
<p><strong>Affected Host:</strong> {{ .Labels.instance }}</p>
|
||||||
|
<p><strong>Affected Service:</strong> {{ .Labels.job }}</p>
|
||||||
|
<p><strong>Alert Subject:</strong> {{ .Annotations.summary }}</p>
|
||||||
|
<p><strong>Trigger Time:</strong> {{ .StartsAt.Format "2006-01-02 15:04:05" }}</p>
|
||||||
|
</div>
|
||||||
|
<!-- End of OpenIM Alert -->
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
@ -0,0 +1,36 @@
|
|||||||
|
# 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.
|
||||||
|
|
||||||
|
groups:
|
||||||
|
- name: instance_down
|
||||||
|
rules:
|
||||||
|
- alert: InstanceDown
|
||||||
|
expr: up == 0
|
||||||
|
for: 1m
|
||||||
|
labels:
|
||||||
|
severity: critical
|
||||||
|
annotations:
|
||||||
|
summary: "Instance {{ $labels.instance }} down"
|
||||||
|
description: "{{ $labels.instance }} of job {{ $labels.job }} has been down for more than 1 minutes."
|
||||||
|
|
||||||
|
- name: database_insert_failure_alerts
|
||||||
|
rules:
|
||||||
|
- alert: DatabaseInsertFailed
|
||||||
|
expr: (increase(msg_insert_redis_failed_total[5m]) > 0) or (increase(msg_insert_mongo_failed_total[5m]) > 0)
|
||||||
|
for: 1m
|
||||||
|
labels:
|
||||||
|
severity: critical
|
||||||
|
annotations:
|
||||||
|
summary: "Increase in MsgInsertRedisFailedCounter or MsgInsertMongoFailedCounter detected"
|
||||||
|
description: "Either MsgInsertRedisFailedCounter or MsgInsertMongoFailedCounter has increased in the last 5 minutes, indicating failures in message insert operations to Redis or MongoDB,maybe the redis or mongodb is crash."
|
@ -0,0 +1,354 @@
|
|||||||
|
# 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.
|
||||||
|
|
||||||
|
# Determines if a message should be sent. If set to false, it triggers a silent sync without a message. If true, it requires triggering a conversation.
|
||||||
|
# For rpc notification, send twice: once as a message and once as a notification.
|
||||||
|
# The options field 'isNotification' indicates if it's a notification.
|
||||||
|
groupCreated:
|
||||||
|
isSendMsg: true
|
||||||
|
|
||||||
|
# Reliability level of the message sending.
|
||||||
|
# Set to 1 to send only when online, 2 for guaranteed delivery.
|
||||||
|
reliabilityLevel: 1
|
||||||
|
|
||||||
|
# This setting is effective only when 'isSendMsg' is true.
|
||||||
|
# It controls whether to count unread messages.
|
||||||
|
unreadCount: false
|
||||||
|
|
||||||
|
# Configuration for offline push notifications.
|
||||||
|
offlinePush:
|
||||||
|
# Enables or disables offline push notifications.
|
||||||
|
enable: false
|
||||||
|
|
||||||
|
# Title for the notification when a group is created.
|
||||||
|
title: "create group title"
|
||||||
|
|
||||||
|
# Description for the notification.
|
||||||
|
desc: "create group desc"
|
||||||
|
|
||||||
|
# Additional information for the notification.
|
||||||
|
ext: "create group ext"
|
||||||
|
|
||||||
|
# Content type is not added here.
|
||||||
|
# Content should use a JSON structure conforming to the protobuf format.
|
||||||
|
|
||||||
|
groupInfoSet:
|
||||||
|
isSendMsg: false
|
||||||
|
reliabilityLevel: 1
|
||||||
|
unreadCount: false
|
||||||
|
offlinePush:
|
||||||
|
enable: false
|
||||||
|
title: "groupInfoSet title"
|
||||||
|
desc: "groupInfoSet desc"
|
||||||
|
ext: "groupInfoSet ext"
|
||||||
|
|
||||||
|
|
||||||
|
joinGroupApplication:
|
||||||
|
isSendMsg: false
|
||||||
|
reliabilityLevel: 1
|
||||||
|
unreadCount: false
|
||||||
|
offlinePush:
|
||||||
|
enable: false
|
||||||
|
title: "joinGroupApplication title"
|
||||||
|
desc: "joinGroupApplication desc"
|
||||||
|
ext: "joinGroupApplication ext"
|
||||||
|
|
||||||
|
memberQuit:
|
||||||
|
isSendMsg: true
|
||||||
|
reliabilityLevel: 1
|
||||||
|
unreadCount: false
|
||||||
|
offlinePush:
|
||||||
|
enable: false
|
||||||
|
title: "memberQuit title"
|
||||||
|
desc: "memberQuit desc"
|
||||||
|
ext: "memberQuit ext"
|
||||||
|
|
||||||
|
groupApplicationAccepted:
|
||||||
|
isSendMsg: false
|
||||||
|
reliabilityLevel: 1
|
||||||
|
unreadCount: false
|
||||||
|
offlinePush:
|
||||||
|
enable: false
|
||||||
|
title: "groupApplicationAccepted title"
|
||||||
|
desc: "groupApplicationAccepted desc"
|
||||||
|
ext: "groupApplicationAccepted ext"
|
||||||
|
|
||||||
|
groupApplicationRejected:
|
||||||
|
isSendMsg: false
|
||||||
|
reliabilityLevel: 1
|
||||||
|
unreadCount: false
|
||||||
|
offlinePush:
|
||||||
|
enable: false
|
||||||
|
title: " title"
|
||||||
|
desc: " desc"
|
||||||
|
ext: " ext"
|
||||||
|
|
||||||
|
|
||||||
|
groupOwnerTransferred:
|
||||||
|
isSendMsg: true
|
||||||
|
reliabilityLevel: 1
|
||||||
|
unreadCount: false
|
||||||
|
offlinePush:
|
||||||
|
enable: false
|
||||||
|
title: "groupOwnerTransferred title"
|
||||||
|
desc: "groupOwnerTransferred desc"
|
||||||
|
ext: "groupOwnerTransferred ext"
|
||||||
|
|
||||||
|
memberKicked:
|
||||||
|
isSendMsg: true
|
||||||
|
reliabilityLevel: 1
|
||||||
|
unreadCount: false
|
||||||
|
offlinePush:
|
||||||
|
enable: false
|
||||||
|
title: "memberKicked title"
|
||||||
|
desc: "memberKicked desc"
|
||||||
|
ext: "memberKicked ext"
|
||||||
|
|
||||||
|
memberInvited:
|
||||||
|
isSendMsg: true
|
||||||
|
reliabilityLevel: 1
|
||||||
|
unreadCount: false
|
||||||
|
offlinePush:
|
||||||
|
enable: false
|
||||||
|
title: "memberInvited title"
|
||||||
|
desc: "memberInvited desc"
|
||||||
|
ext: "memberInvited ext"
|
||||||
|
|
||||||
|
memberEnter:
|
||||||
|
isSendMsg: true
|
||||||
|
reliabilityLevel: 1
|
||||||
|
unreadCount: false
|
||||||
|
offlinePush:
|
||||||
|
enable: false
|
||||||
|
title: "memberEnter title"
|
||||||
|
desc: "memberEnter desc"
|
||||||
|
ext: "memberEnter ext"
|
||||||
|
|
||||||
|
groupDismissed:
|
||||||
|
isSendMsg: true
|
||||||
|
reliabilityLevel: 1
|
||||||
|
unreadCount: false
|
||||||
|
offlinePush:
|
||||||
|
enable: false
|
||||||
|
title: "groupDismissed title"
|
||||||
|
desc: "groupDismissed desc"
|
||||||
|
ext: "groupDismissed ext"
|
||||||
|
|
||||||
|
groupMuted:
|
||||||
|
isSendMsg: true
|
||||||
|
reliabilityLevel: 1
|
||||||
|
unreadCount: false
|
||||||
|
offlinePush:
|
||||||
|
enable: false
|
||||||
|
title: "groupMuted title"
|
||||||
|
desc: "groupMuted desc"
|
||||||
|
ext: "groupMuted ext"
|
||||||
|
|
||||||
|
groupCancelMuted:
|
||||||
|
isSendMsg: true
|
||||||
|
reliabilityLevel: 1
|
||||||
|
unreadCount: false
|
||||||
|
offlinePush:
|
||||||
|
enable: false
|
||||||
|
title: "groupCancelMuted title"
|
||||||
|
desc: "groupCancelMuted desc"
|
||||||
|
ext: "groupCancelMuted ext"
|
||||||
|
defaultTips:
|
||||||
|
tips: "group Cancel Muted"
|
||||||
|
|
||||||
|
|
||||||
|
groupMemberMuted:
|
||||||
|
isSendMsg: true
|
||||||
|
reliabilityLevel: 1
|
||||||
|
unreadCount: false
|
||||||
|
offlinePush:
|
||||||
|
enable: false
|
||||||
|
title: "groupMemberMuted title"
|
||||||
|
desc: "groupMemberMuted desc"
|
||||||
|
ext: "groupMemberMuted ext"
|
||||||
|
|
||||||
|
groupMemberCancelMuted:
|
||||||
|
isSendMsg: true
|
||||||
|
reliabilityLevel: 1
|
||||||
|
unreadCount: false
|
||||||
|
offlinePush:
|
||||||
|
enable: false
|
||||||
|
title: "groupMemberCancelMuted title"
|
||||||
|
desc: "groupMemberCancelMuted desc"
|
||||||
|
ext: "groupMemberCancelMuted ext"
|
||||||
|
|
||||||
|
groupMemberInfoSet:
|
||||||
|
isSendMsg: false
|
||||||
|
reliabilityLevel: 1
|
||||||
|
unreadCount: false
|
||||||
|
offlinePush:
|
||||||
|
enable: false
|
||||||
|
title: "groupMemberInfoSet title"
|
||||||
|
desc: "groupMemberInfoSet desc"
|
||||||
|
ext: "groupMemberInfoSet ext"
|
||||||
|
|
||||||
|
groupInfoSetAnnouncement:
|
||||||
|
isSendMsg: true
|
||||||
|
reliabilityLevel: 1
|
||||||
|
unreadCount: false
|
||||||
|
offlinePush:
|
||||||
|
enable: false
|
||||||
|
title: "groupInfoSetAnnouncement title"
|
||||||
|
desc: "groupInfoSetAnnouncement desc"
|
||||||
|
ext: "groupInfoSetAnnouncement ext"
|
||||||
|
|
||||||
|
|
||||||
|
groupInfoSetName:
|
||||||
|
isSendMsg: true
|
||||||
|
reliabilityLevel: 1
|
||||||
|
unreadCount: false
|
||||||
|
offlinePush:
|
||||||
|
enable: false
|
||||||
|
title: "groupInfoSetName title"
|
||||||
|
desc: "groupInfoSetName desc"
|
||||||
|
ext: "groupInfoSetName ext"
|
||||||
|
|
||||||
|
|
||||||
|
#############################friend#################################
|
||||||
|
friendApplicationAdded:
|
||||||
|
isSendMsg: false
|
||||||
|
reliabilityLevel: 1
|
||||||
|
unreadCount: false
|
||||||
|
offlinePush:
|
||||||
|
enable: false
|
||||||
|
title: "Somebody applies to add you as a friend"
|
||||||
|
desc: "Somebody applies to add you as a friend"
|
||||||
|
ext: "Somebody applies to add you as a friend"
|
||||||
|
|
||||||
|
friendApplicationApproved:
|
||||||
|
isSendMsg: true
|
||||||
|
reliabilityLevel: 1
|
||||||
|
unreadCount: false
|
||||||
|
offlinePush:
|
||||||
|
enable: true
|
||||||
|
title: "Someone applies to add your friend application"
|
||||||
|
desc: "Someone applies to add your friend application"
|
||||||
|
ext: "Someone applies to add your friend application"
|
||||||
|
|
||||||
|
friendApplicationRejected:
|
||||||
|
isSendMsg: false
|
||||||
|
reliabilityLevel: 1
|
||||||
|
unreadCount: false
|
||||||
|
offlinePush:
|
||||||
|
enable: true
|
||||||
|
title: "Someone rejected your friend application"
|
||||||
|
desc: "Someone rejected your friend application"
|
||||||
|
ext: "Someone rejected your friend application"
|
||||||
|
|
||||||
|
friendAdded:
|
||||||
|
isSendMsg: false
|
||||||
|
reliabilityLevel: 1
|
||||||
|
unreadCount: false
|
||||||
|
offlinePush:
|
||||||
|
enable: true
|
||||||
|
title: "We have become friends"
|
||||||
|
desc: "We have become friends"
|
||||||
|
ext: "We have become friends"
|
||||||
|
|
||||||
|
friendDeleted:
|
||||||
|
isSendMsg: false
|
||||||
|
reliabilityLevel: 1
|
||||||
|
unreadCount: false
|
||||||
|
offlinePush:
|
||||||
|
enable: true
|
||||||
|
title: "deleted a friend"
|
||||||
|
desc: "deleted a friend"
|
||||||
|
ext: "deleted a friend"
|
||||||
|
|
||||||
|
friendRemarkSet:
|
||||||
|
isSendMsg: false
|
||||||
|
reliabilityLevel: 1
|
||||||
|
unreadCount: false
|
||||||
|
offlinePush:
|
||||||
|
enable: true
|
||||||
|
title: "Your friend's profile has been changed"
|
||||||
|
desc: "Your friend's profile has been changed"
|
||||||
|
ext: "Your friend's profile has been changed"
|
||||||
|
|
||||||
|
blackAdded:
|
||||||
|
isSendMsg: false
|
||||||
|
reliabilityLevel: 1
|
||||||
|
unreadCount: false
|
||||||
|
offlinePush:
|
||||||
|
enable: true
|
||||||
|
title: "blocked a user"
|
||||||
|
desc: "blocked a user"
|
||||||
|
ext: "blocked a user"
|
||||||
|
|
||||||
|
blackDeleted:
|
||||||
|
isSendMsg: false
|
||||||
|
reliabilityLevel: 1
|
||||||
|
unreadCount: false
|
||||||
|
offlinePush:
|
||||||
|
enable: true
|
||||||
|
title: "Remove a blocked user"
|
||||||
|
desc: "Remove a blocked user"
|
||||||
|
ext: "Remove a blocked user"
|
||||||
|
|
||||||
|
friendInfoUpdated:
|
||||||
|
isSendMsg: false
|
||||||
|
reliabilityLevel: 1
|
||||||
|
unreadCount: false
|
||||||
|
offlinePush:
|
||||||
|
enable: true
|
||||||
|
title: "friend info updated"
|
||||||
|
desc: "friend info updated"
|
||||||
|
ext: "friend info updated"
|
||||||
|
|
||||||
|
#####################user#########################
|
||||||
|
userInfoUpdated:
|
||||||
|
isSendMsg: false
|
||||||
|
reliabilityLevel: 1
|
||||||
|
unreadCount: false
|
||||||
|
offlinePush:
|
||||||
|
enable: true
|
||||||
|
title: "Remove a blocked user"
|
||||||
|
desc: "Remove a blocked user"
|
||||||
|
ext: "Remove a blocked user"
|
||||||
|
|
||||||
|
userStatusChanged:
|
||||||
|
isSendMsg: false
|
||||||
|
reliabilityLevel: 1
|
||||||
|
unreadCount: false
|
||||||
|
offlinePush:
|
||||||
|
enable: false
|
||||||
|
title: "user status changed"
|
||||||
|
desc: "user status changed"
|
||||||
|
ext: "user status changed"
|
||||||
|
|
||||||
|
#####################conversation#########################
|
||||||
|
conversationChanged:
|
||||||
|
isSendMsg: false
|
||||||
|
reliabilityLevel: 1
|
||||||
|
unreadCount: false
|
||||||
|
offlinePush:
|
||||||
|
enable: true
|
||||||
|
title: "conversation changed"
|
||||||
|
desc: "conversation changed"
|
||||||
|
ext: "conversation changed"
|
||||||
|
|
||||||
|
conversationSetPrivate:
|
||||||
|
isSendMsg: true
|
||||||
|
reliabilityLevel: 1
|
||||||
|
unreadCount: false
|
||||||
|
offlinePush:
|
||||||
|
enable: true
|
||||||
|
title: "burn after reading"
|
||||||
|
desc: "burn after reading"
|
||||||
|
ext: "burn after reading"
|
@ -0,0 +1,99 @@
|
|||||||
|
# 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.
|
||||||
|
|
||||||
|
# my global config
|
||||||
|
global:
|
||||||
|
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
|
||||||
|
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
|
||||||
|
# scrape_timeout is set to the global default (10s).
|
||||||
|
|
||||||
|
# Alertmanager configuration
|
||||||
|
alerting:
|
||||||
|
alertmanagers:
|
||||||
|
- static_configs:
|
||||||
|
- targets: ['172.28.0.1:19093']
|
||||||
|
|
||||||
|
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
|
||||||
|
rule_files:
|
||||||
|
- "instance-down-rules.yml"
|
||||||
|
# - "first_rules.yml"
|
||||||
|
# - "second_rules.yml"
|
||||||
|
|
||||||
|
# A scrape configuration containing exactly one endpoint to scrape:
|
||||||
|
# Here it's Prometheus itself.
|
||||||
|
scrape_configs:
|
||||||
|
# The job name is added as a label "job='job_name'"" to any timeseries scraped from this config.
|
||||||
|
# Monitored information captured by prometheus
|
||||||
|
- job_name: 'node-exporter'
|
||||||
|
static_configs:
|
||||||
|
- targets: [ '172.28.0.1:19100' ]
|
||||||
|
labels:
|
||||||
|
namespace: 'default'
|
||||||
|
|
||||||
|
# prometheus fetches application services
|
||||||
|
- job_name: 'openimserver-openim-api'
|
||||||
|
static_configs:
|
||||||
|
- targets: [ '172.28.0.1:20100' ]
|
||||||
|
labels:
|
||||||
|
namespace: 'default'
|
||||||
|
- job_name: 'openimserver-openim-msggateway'
|
||||||
|
static_configs:
|
||||||
|
- targets: [ '172.28.0.1:20140' ]
|
||||||
|
labels:
|
||||||
|
namespace: 'default'
|
||||||
|
- job_name: 'openimserver-openim-msgtransfer'
|
||||||
|
static_configs:
|
||||||
|
- targets: [ 172.28.0.1:21400, 172.28.0.1:21401, 172.28.0.1:21402, 172.28.0.1:21403 ]
|
||||||
|
labels:
|
||||||
|
namespace: 'default'
|
||||||
|
- job_name: 'openimserver-openim-push'
|
||||||
|
static_configs:
|
||||||
|
- targets: [ '172.28.0.1:20170' ]
|
||||||
|
labels:
|
||||||
|
namespace: 'default'
|
||||||
|
- job_name: 'openimserver-openim-rpc-auth'
|
||||||
|
static_configs:
|
||||||
|
- targets: [ '172.28.0.1:20160' ]
|
||||||
|
labels:
|
||||||
|
namespace: 'default'
|
||||||
|
- job_name: 'openimserver-openim-rpc-conversation'
|
||||||
|
static_configs:
|
||||||
|
- targets: [ '172.28.0.1:20230' ]
|
||||||
|
labels:
|
||||||
|
namespace: 'default'
|
||||||
|
- job_name: 'openimserver-openim-rpc-friend'
|
||||||
|
static_configs:
|
||||||
|
- targets: [ '172.28.0.1:20120' ]
|
||||||
|
labels:
|
||||||
|
namespace: 'default'
|
||||||
|
- job_name: 'openimserver-openim-rpc-group'
|
||||||
|
static_configs:
|
||||||
|
- targets: [ '172.28.0.1:20150' ]
|
||||||
|
labels:
|
||||||
|
namespace: 'default'
|
||||||
|
- job_name: 'openimserver-openim-rpc-msg'
|
||||||
|
static_configs:
|
||||||
|
- targets: [ '172.28.0.1:20130' ]
|
||||||
|
labels:
|
||||||
|
namespace: 'default'
|
||||||
|
- job_name: 'openimserver-openim-rpc-third'
|
||||||
|
static_configs:
|
||||||
|
- targets: [ '172.28.0.1:21301' ]
|
||||||
|
labels:
|
||||||
|
namespace: 'default'
|
||||||
|
- job_name: 'openimserver-openim-rpc-user'
|
||||||
|
static_configs:
|
||||||
|
- targets: [ '172.28.0.1:20110' ]
|
||||||
|
labels:
|
||||||
|
namespace: 'default'
|
Loading…
Reference in new issue