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 工程 ...
随机推荐
- 7系列FPGA远程更新方案-QuickBoot(转)
reference: http://xilinx.eetrend.com/d6-xilinx/article/2014-04/7009.html reference : quickboot meth ...
- JSP组件Telerik UI for JSP发布R1 2019 SP1|附下载
Telerik UI for JSP拥有由Kendo UI for jQuery支持的40+ JSP组件,同时通过Kendo UI for jQuery的支持能使用JSP封装包构建现代的HTML5和J ...
- DevExpress WinForms v18.2新版亮点(四)
行业领先的.NET界面控件2018年第二次重大更新——DevExpress v18.2日前正式发布,本站将以连载的形式为大家介绍各版本新增内容.本文将介绍了DevExpress WinForms v1 ...
- Windows下安装Tensorflow报错 “DLL load failed:找不到指定的模块"
Windows下安装完tensorflow后,在cmd下运行python后import tensorflow出现如下错误: Traceback (most recent call last): Fi ...
- 关于对Access数据库的学习报告
学习Access数据库的报告 一.前言 一开始我对access一窍不通,甚至不知道它是干什么的,后来经过网上资料的查阅对它略有了解.microsoft office access是由微软发布的关联式数 ...
- Spring、Commons的BeanUtils.copyProperties用法
如果两个对象A.B的大部分属性的名字都一样,此时想将A的属性值复制给B,一个一个属性GET\SET代码量太大,可以通过复制属性的方式减小工作量,同时代码看起来更加简洁明了,复制属性可以用Spring或 ...
- DocumentFragment --更快捷操作DOM的途径
使用DocumentFragment将一批子元素添加到任何类似node的父节点上,对这批子元素的操作不需要一个真正的根节点.可以不依赖可见的DOM来构造一个DOM结构,而效率高是它真正的优势,试验表明 ...
- SQL注入之Sqli-labs系列第二十九关(基于WAF防护的单引号报错注入)
开始挑战第二十九关(Protection with WAF) 0x1查看源码 (1)login.php页面存在防护,只要检测到存在问题就跳转到hacked.php页面(其他信息看备注) 0x2 for ...
- [转]An Intuitive Explanation of Convolutional Neural Networks
An Intuitive Explanation of Convolutional Neural Networks https://ujjwalkarn.me/2016/08/11/intuitive ...
- 学习Java JDBC,看这篇就够了
JDBC (Java DB Connection)---Java数据库连接 JDBC是一种可用于运行SQL语句的JAVA API(ApplicationProgramming Interface应用程 ...