Skip to content

aliyun/infinsight

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Introduce


preview

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:

  1. 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).
  2. 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.
  3. 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.
  4. 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)
  5. 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.
  6. 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.

Simple Usage


Dependency

Infinsight depends on MongoDB for config management and data persistence, and depends on Grafana for data visualization.


If you don't have any base enviroument, just run AutoDeploy.sh, it's will be help you to download and config all env you need

1. Build

  1. Make sure "gcc" command is exist
  2. 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
  1. Run "sh AutoDeploy.sh", script will be config your base env and compile you Infinsight, like this build output-dir 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

2. Run

  1. 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
  2. Config Grafana Data Source

    1. Add Data Source 4-1

    4-2 we use Prometheus Http API to communicate with Grafana

    4-3

    Set "Name" as "Infinsight", you can use more standard grafana template easily

  3. 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
  4. Load Grafana Template select output/service_template/mongodb/grafana.json then, Infinsight is starting to monitor your service

Query Grammar

  1. 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

  2. cauculate if you want to calculate the monitor value, you can add calculate expression in "[]"

calculate function:

  1. arrayDiff($i)
  2. arrayAdd($i, $j)
  3. arraySub($i, $j)
  4. arrayMul($i, $j)
  5. arrayDiv($i, $j)
  6. arrayMod($i, $j)
  7. arrayDigitAdd($i, num)
  8. arrayDigitSub($i, num)
  9. arrayDigitMul($i, num)
  10. arrayDigitDiv($i, num)
  11. 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

  1. 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

Join us


We have a WeChat group so that users can join and discuss:
wechat

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages