GithubHelp home page GithubHelp logo

withlin / kong-logs-metrics Goto Github PK

View Code? Open in Web Editor NEW
47.0 6.0 8.0 19.58 MB

网关性能分析和日志可视化【此项目已经不维护了】

License: MIT License

JavaScript 92.02% HTML 0.05% Vue 4.97% CSS 1.16% Go 1.80%
kong-gateway metrics log golang gin iview

kong-logs-metrics's Introduction

Kong Statistical Analysis Of Performance

KongApi Gateway Log Metrics 后台是基于 go 写的,web框架采用的gin,前台用的是Vue,UI组件 采用的是iView

预览(OverView)

效果图,如下所示:

折柱混合(报表)

饼状图 (报表)

表格

日志可视化

Getting Started

//Logstash 配置参考
input {
  tcp {
    type => "tcp"
    port => 6666
    mode => "server"
  }
}
filter  {
      json {
            source => "message"
        }
      date {
        match => ["started_at", "yyyy-MM-dd HH:mm:ss,SSS", "UNIX_MS"]
        target=>"started_at"
        locale => "cn"
        timezone => "Asia/Shanghai"
    }
}
output {
  elasticsearch { hosts => ["localhost:9200"] }
  stdout { codec => rubydebug }
}




使用kong dashboard添加插件tcp log插件,配置的地址就写logstash的地址,端口为上面配置设置的端口

git clone https://github.com/DevWithLin/kong-logs-metrics.git

cd  kong-logs-metrics

##如何编译?

//下载 dep包管理工具
go get -u github.com/golang/dep/cmd/dep


//安装依赖
dep ensure


vim config.yml
配置说明

elasticsearch:
  host: http://192.168.199.17:9200/   //ES地址
  setsniff: false  
  logstashtype: logs                  //索引类型

go:
  apiprefix: /v1/api                 //api 分组
  port: 7777                        //端口
  tokenmaxage: 10800                //Token过期时间
  env: development                  //开发环境
  logdir:                           //日志文件夹
  tokensecret: AstrRAflaEAA          //JWT的字符串

mysql: 
    dialect: mysql                  
    database: test
    user: root
    passowrd: 000000
    charset: utf8mb4
    host: 192.168.199.16
    port: 3306
    maxidleconns: 5
    maxopenconns: 10

redis: 
    host: 192.168.199.17
    port: 6379
    passowrd: zzzzzzz
    maxIdle: 3
    maxactive: 5

//启动后台服务
go run main.go


cd  kong-logs-metrics/website


//还原依赖  注意:Node版本使用v8.10.0 最新版本不兼容(webpack)
npm i 或者 cnpm i

//启动前端项目
npm run dev


//如果后台部署到其他的服务器上 需要修改前端地址

vim  kong-logs-metrics/website/src/api/index.js

let serverAddress='http://localhost:7777/v1/api'; //修改此处服务端地址即可

//发布项目

npm run build  //然后把项目静态文件部署到nginx上。

kong-logs-metrics's People

Contributors

withlin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

kong-logs-metrics's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.