This is a brief introduction of Inspector, please visit english wiki or chinese wiki if you want to see more details including architecture, data flow, performance and so on.
Infinsight is a MicroService-Oriented General Monitor System With Second Granularity.
We aimd at providing a general monitoring system for most of common service(mysql, redis, mongodb etc) and microservice with high precision and high timeliness to help users troubleshooting easily. In addition we alse expect there is a monitoring system should be easily to deploy and use. So we develop Infinsight, here are some basic feature of it:
- Infinsight is a Agentless monitor system, it's collecte status of target server remotely with local client(such as mysql-client, redis-client, mongo-client, http-client etc.). So you can deploy it with at lease 1 machine(or VM).
- Infinsight is a Quasi-Realtime monitor system. it's has two means: the one is Second Precision, the other is Second Timeliness. That is Infinsight can display the service status of target service per second in almost realtime.
- Infinsight is a High Performance monitoring system. Infinsight can service whit at lease thousands of target services with just one machine and query data within few milliseconds.
- Infinsight is a monitor system with High Compression Ratio. It can store trillions records just using terabytes of storage capacity. Statistics based on actual scenarios, the compression ratio we can achieve is: MongoDB(32:1), Http+Json(80:1)
- Infinsight is a Schemaless monitor system. you don't need to specify which metrics to monitor, we will be get and save all of status. you can just add or delete metric with valid format(json bson or key-value) if you want to add a new metrics, infinsight will automatically senses the change of metrics and add new one.
- Infinsight is a monitor system that support Distributed Horizontal Expansion. you can just copy Infinshgit program to an other machine and start as same configuration, Infinsight will be automatically senses changes of topology and performs balance.
Dependency
Infinsight depends on MongoDB for config management and data persistence, and depends on Grafana for data visualization.
- Make sure "gcc" command is exist
- Open and update “Base.cfg”, Base.cfg is a bash script. If you don't have "golang","mongodb" or "grafana" env, please don't change anything.
- modify PATH GOROOT GOPATH for "go" command
- modify PATH for "mongo" command
- modify MongoDB_IP MongoDB_PORT and all MongoDB_* to connect an exist MongoDB Server
- modify Grafana_IP Grafana_PORT and all Grafana_* to connect an exist Grafana Server
- modify Inspector_*_PORT if port confict
- Run "sh AutoDeploy.sh", script will be config your base env and compile you Infinsight, like this your output directory will be like this:
- api_server, store_server, collector_server is 3 parts of Infinsight
- service_template is all template of all service we support. It's will help you to register your service and instance easily
- go mongodb-linux-x86_64-4.0.6 grafana-6.0.1 is base envirenment
- tar for downloading
- all script(*.sh) is start and stop script for each service
-
Start Infinshgit
- cd output
- sh start_mongo.sh (if you don't have mongo server in your system)
- sh start_grafana.sh (if you don't have grafana server in your system)
- sh start_inspector.sh
-
Config Grafana Data Source
we use Prometheus Http API to communicate with Grafana
Set "Name" as "Infinsight", you can use more standard grafana template easily
-
Add New Service
- cd output/service_template
- open service.cfg, service.cfg is a bash script
- config MongoIP and MongoPort
- config service_name to whatever you want
- config service_type to one of [mysql, redis, mongodb, http_json]
- add you instance list as example
- run "sh register.sh"(make sure "mongo" command exist), in the directory you choose for service_type will be create 4 files: add_instance.js add_service.js create_index.js and grafana.json
-
Load Grafana Template select output/service_template/mongodb/grafana.json then, Infinsight is starting to monitor your service
-
directly show all "mongodb" in image below is must be the "service name", never change it. all metrics is just json/bson path or monitor key
-
cauculate if you want to calculate the monitor value, you can add calculate expression in "[]"
calculate function:
- arrayDiff($i)
- arrayAdd($i, $j)
- arraySub($i, $j)
- arrayMul($i, $j)
- arrayDiv($i, $j)
- arrayMod($i, $j)
- arrayDigitAdd($i, num)
- arrayDigitSub($i, num)
- arrayDigitMul($i, num)
- arrayDigitDiv($i, num)
- arrayDigitMod($i, num)
variable of params $i mean the i's line of metrics for example: $1 means "mongodb|network|bytesIn"
special variable $0 means "each metric", and it's always used in arrayDiff($0) function
- regexp you can also use regexp to specify a group of metrics, just use reg() function. and the "legend" is the show name of each metric, filed$i means the i's filed. "name" means the last field