lapis 项目添加prometheus 监控集成grafana
操作很简单,主要是进行界面的配置以及prometheus 服务的配置,
可以和https://www.cnblogs.com/rongfengliang/p/10074044.html &&
https://www.cnblogs.com/rongfengliang/p/10038706.html 结合起来看
环境准备
- docker-compose
version: "3"
services:
api:
build: ./
ports:
- "8080:8080"
volumes:
- "./web:/web"
g:
image: grafana/grafana
ports:
- "3000:3000"
p:
image: prom/prometheus
volumes:
- "./prometheus.yml:/etc/prometheus/prometheus.yml"
ports:
- "9090:9090"
- prometheus 配置
prometheus.yml 文件
scrape_configs:
- job_name: nginx
metrics_path: /status/format/prometheus
static_configs:
- targets: ['api:8080']
- dockerfile
基本项目,使用数据卷挂载
FROM dalongrong/lapis-1.7.0:metrics
ENTRYPOINT [ "lapis","server" ]
- 添加几个测试路由
web/app.lua 文件,很简单都是get 方法
local lapis = require("lapis")
local app = lapis.Application()
app:get("/", function()
return "Welcome to Lapis dalongrong " .. require("lapis.version")
end)
app:get("/users", function()
return "users" .. require("lapis.version")
end)
app:get("/apps", function()
return "apps" .. require("lapis.version")
end)
app:get("/mobiles", function()
return "mobiles" .. require("lapis.version")
end)
app:get("/paas", function()
return "paas " .. require("lapis.version")
end)
app:get("/saas", function()
return "saas " .. require("lapis.version")
end)
return app
启动&&测试
- 启动
docker-compose up -d
- 效果

参考资料
https://www.cnblogs.com/rongfengliang/p/10074044.html
https://www.cnblogs.com/rongfengliang/p/10038706.html
https://github.com/rongfengliang/lapis-docker
lapis 项目添加prometheus 监控集成grafana的更多相关文章
- lapis 项目添加prometheus 监控
lapis 是基于openresty 扩展的,所以直接将支持prometheus的模块构建进openresty 就可以了 我使用的是nginx-module-vts 模块 环境准备 我已经构建好了 ...
- kubernetes生态--交付prometheus监控及grafana炫酷dashboard到k8s集群
由于docker容器的特殊性,传统的zabbix无法对k8s集群内的docker状态进行监控,所以需要使用prometheus来进行监控: 什么是Prometheus? Prometheus是由Sou ...
- 容器编排系统K8s之Prometheus监控系统+Grafana部署
前文我们聊到了k8s的apiservice资源结合自定义apiserver扩展原生apiserver功能的相关话题,回顾请参考:https://www.cnblogs.com/qiuhom-1874/ ...
- 为springboot项目添加springboot-admin监控
我们知道spring-boot-actuator暴露了大量统计和监控信息的端点,spring-boot-admin 就是为此提供的监控项目. 先来看看大概会提供什么样的功能 从图中可以看出,主要内容都 ...
- 手把手教你使用 Prometheus 监控 JVM
概述 当你的 Java 业务容器化上 K8S 后,如果对其进行监控呢?Prometheus 社区开发了 JMX Exporter 来导出 JVM 的监控指标,以便使用 Prometheus 来采集监控 ...
- 基于k8s集群部署prometheus监控ingress nginx
目录 基于k8s集群部署prometheus监控ingress nginx 1.背景和环境概述 2.修改prometheus配置 3.检查是否生效 4.配置grafana图形 基于k8s集群部署pro ...
- 基于k8s集群部署prometheus监控etcd
目录 基于k8s集群部署prometheus监控etcd 1.背景和环境概述 2.修改prometheus配置 3.检查是否生效 4.配置grafana图形 基于k8s集群部署prometheus监控 ...
- 图文详解Prometheus监控+Grafana+Alertmanager告警安装使用
一:前言 一个服务上线了后,你想知道这个服务是否可用,需要监控.假如线上出故障了,你要先于顾客感知错误,你需要监控.还有对数据库,服务器的监控,等等各层面的监控. 近年来,微服务架构的流行,服务数越来 ...
- Spring Boot 使用 Micrometer 集成 Prometheus 监控 Java 应用性能
转载自:https://cloud.tencent.com/developer/article/1508319 文章目录1.Micrometer 介绍2.环境.软件准备3.Spring Boot 工程 ...
随机推荐
- 《Python》常用内置模块
一.time模块(时间模块) 三种格式: 1.时间戳时间(timestamp):浮点数,秒为单位,从1970年1月1日0时距今的时间 1970.1.1 0:0:0 英国伦敦时间(开始时间) 1970 ...
- 7.8 C++容器适配器
参考:http://www.weixueyuan.net/view/6405.html 总结: 容器适配器是用基本容器实现的一些新容器,这些容器可以用于描述更高级的数据结构. 容器适配器有三种:sta ...
- DevExpress WinForms v18.2新版亮点(一)
行业领先的.NET界面控件2018年第二次重大更新——DevExpress v18.2日前正式发布,本站将以连载的形式为大家介绍各版本新增内容.本文将介绍了DevExpress WinForms v1 ...
- LibHaru编译使用
最近公司准备在PDF方面发力了,我也要行动起来,就找到了LibHaru这个开源库 编译Libharu需要用到zlib库和libpng库,libpng库又依赖zlib库. zlib 下载地址:http: ...
- 记一次ios加急上架经历
https://developer.apple.com//contact/app-store/?topic=expedite app迭代版本上架之前一直好好的没报错,没crash,但是有一次加急上架, ...
- REST easy with kbmMW #20 – OpenAPI and Swagger UI
即将推出的kbmMW更新不仅是一些bug修正,同时将包含一个新的主要功能:客户端存根生成器框架. 那什么是客户端存根生成器框架呢? 他是一个基于kbmMW smart services,可以生成由各种 ...
- 2019-03-18-day013-装饰器与内置函数
上周回顾 函数: def 函数名(): 缩进 函数体 闭包: a = 50 def func(): a = 10 def avg(): print(a) 函数名的使用: 当做值被赋值给变量 当做返回值 ...
- SSH连接虚拟机中的Ubuntu(转)
摘要:主要是解决不能使用ssh远程Ubuntu的问题.使用的远程工具是putty.也可以使用xshell.ubunut12.0.4是装在虚拟机中的.不过这个应该没有什么影响. 一:问题的出现 前两天使 ...
- 生成式模型 VS 判别式模型
1 定义 1.1 生成式模型 生成式模型(Generative Model)会对x和y的联合分布p(x,y)建模,然后通过贝叶斯公式来求得 p(yi|x),然后选取使得p(yi|x) 最大的 yi,即 ...
- matlab handle plot
https://cn.mathworks.com/help/matlab/ref/plotyy.html