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 工程 ...
随机推荐
- HTML--思维导图
HTML--思维导图
- Linux 最小安装常用包
Linux最小安装后很多常用的工具都没有,但直接通过yum install 文件名的方式可能无法找到,汇总于此,随时更新: CentOS7 1.如果要通过SecureCRT上直接上传下载文件,最简单的 ...
- python笔记7-if中的is ;in ;not搭配用法
names="111 222 333" print("111" in names)#返回的是True,用in返回的是布尔值in在里面 print("1 ...
- .NET实现字符串base64编码
using System; using System.Text; using System.IO; using System.Security; using System.Security.Crypt ...
- Node.js 回调函数 1) 阻塞 ,同步 2) 非阻塞 ,异步.
1.阻塞. 同步. 1) 读取的文件: input.txt 菜鸟教程官网地址:www.runoob.com 2) main.js var fs = require("fs"); / ...
- python scrapy 数据处理时间格式转换
def show(self,response): # print(response.url) title = response.xpath('//main/div/div/div/div/h1/tex ...
- Python 通过队列实现一个生产者消费者模型
import time from multiprocessing import Process,Queue #生产者 def producer(q): for i in range(10): time ...
- scrollIntoView()方法
该方法用于建立一个锚点,点击锚点,会跳到相应的内容,且该内容头部与浏览器头部平齐 实例: <html> <head> <title>TODO supply a ti ...
- promise、async和await之执行顺序
async function async1(){ console.log('async1 start') await async2() console.log('async1 end') } asyn ...
- Set和Map数据结构
1.Set ES6 提供了新的数据结构 Set.它类似于数组,但是成员的值都是唯一的,没有重复的值. Set 本身是一个构造函数,用来生成 Set 数据结构. 2.Map JavaScript 的对象 ...