操作很简单,主要是进行界面的配置以及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的更多相关文章

  1. lapis 项目添加prometheus 监控

      lapis 是基于openresty 扩展的,所以直接将支持prometheus的模块构建进openresty 就可以了 我使用的是nginx-module-vts 模块 环境准备 我已经构建好了 ...

  2. kubernetes生态--交付prometheus监控及grafana炫酷dashboard到k8s集群

    由于docker容器的特殊性,传统的zabbix无法对k8s集群内的docker状态进行监控,所以需要使用prometheus来进行监控: 什么是Prometheus? Prometheus是由Sou ...

  3. 容器编排系统K8s之Prometheus监控系统+Grafana部署

    前文我们聊到了k8s的apiservice资源结合自定义apiserver扩展原生apiserver功能的相关话题,回顾请参考:https://www.cnblogs.com/qiuhom-1874/ ...

  4. 为springboot项目添加springboot-admin监控

    我们知道spring-boot-actuator暴露了大量统计和监控信息的端点,spring-boot-admin 就是为此提供的监控项目. 先来看看大概会提供什么样的功能 从图中可以看出,主要内容都 ...

  5. 手把手教你使用 Prometheus 监控 JVM

    概述 当你的 Java 业务容器化上 K8S 后,如果对其进行监控呢?Prometheus 社区开发了 JMX Exporter 来导出 JVM 的监控指标,以便使用 Prometheus 来采集监控 ...

  6. 基于k8s集群部署prometheus监控ingress nginx

    目录 基于k8s集群部署prometheus监控ingress nginx 1.背景和环境概述 2.修改prometheus配置 3.检查是否生效 4.配置grafana图形 基于k8s集群部署pro ...

  7. 基于k8s集群部署prometheus监控etcd

    目录 基于k8s集群部署prometheus监控etcd 1.背景和环境概述 2.修改prometheus配置 3.检查是否生效 4.配置grafana图形 基于k8s集群部署prometheus监控 ...

  8. 图文详解Prometheus监控+Grafana+Alertmanager告警安装使用

    一:前言 一个服务上线了后,你想知道这个服务是否可用,需要监控.假如线上出故障了,你要先于顾客感知错误,你需要监控.还有对数据库,服务器的监控,等等各层面的监控. 近年来,微服务架构的流行,服务数越来 ...

  9. Spring Boot 使用 Micrometer 集成 Prometheus 监控 Java 应用性能

    转载自:https://cloud.tencent.com/developer/article/1508319 文章目录1.Micrometer 介绍2.环境.软件准备3.Spring Boot 工程 ...

随机推荐

  1. Bluedroid: 音频数据的传输流程

    一. UIPC:   Audio Flinger获取到a2dp的hw module,然后蓝牙协议栈有专用于发送和接收media数据的线程,名称:btif_media_task.   蓝牙与Audio的 ...

  2. 进程创建过程详解 CreateProcess

    转载请您注明出处:http://www.cnblogs.com/lsh123/p/7405796.html 0x01 CreateProcessW CreateProcess的使用有ANSI版本的Cr ...

  3. DevExpress v18.1新版亮点——Reporting篇(一)

    用户界面套包DevExpress v18.1日前终于正式发布,本站将以连载的形式为大家介绍各版本新增内容.本文将介绍了DevExpress Reporting v18.1 的新功能,快来下载试用新版本 ...

  4. SPOJ - AMR11H (容斥原理)

    Enough with this Harry Potter, please! What are we, twelve-year olds?  Let's get our teeth into some ...

  5. ISO-8859-1和GBK互转

    String slogn = "极简主义"; byte[] bytes = slogn.getBytes("GBK");// 编码:字符串变成字节数组 输入 参 ...

  6. 微软Power BI报表服务器学习总览

    今天,微软宣布了8月更新Power BI Report Server!此版本包含一些新功能,包括一些备受期待的项目,如报表主题,条件格式改进和报表页面工具提示. 报告 报告主题 用于触发操作的按钮 组 ...

  7. hadoop day 3

    1.map:局部处理:reduce:汇总 mapper对数据做切分,一份程序在不同的DataNode上独立运行对数据进行处理,reduce程序将所有DataNode上的统计数据进行汇总 Mapper& ...

  8. DG搭建方式区分

    DG搭建三种方式: 一.异机恢复,restore database,recover database 二. duplicate target database for standby from act ...

  9. Stiring公式证明

  10. 一道DP

    也是校赛学长出的一道题~想穿了很简单..但我还是听了学长讲才明白. 观察力有待提高. Problem D: YaoBIG’s extra homeworkTime LimitMemory Limit1 ...