操作很简单,主要是进行界面的配置以及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. 文件上传FormData

    <div class="modal-dialog"> <div class="modal-content"> <div class ...

  2. js 冒泡事件阻止 父层事件影响子层

    当父层 与子层 有相同的事件时,但子层跟父层执行的内容却不一样时 为了 防止 父层事件对子层造成影响我们可以在子层的方法里做如下操作 function A (event){ event.stopPro ...

  3. Java实验2

    1.给定一组字符,编程输出里面数值最大者. package experiment; import java.util.Arrays; public class ShenYue { public sta ...

  4. Ubuntu16.04 python2.7升级python3.5

    正常情况下,你安装好ubuntu16.04版本之后,系统会自带 python2.7版本,如果需要下载新版本的python3.5,就需要进行更新.下面给出具体教程: 1.首先在ubuntu的终端tern ...

  5. byte[]->new String(byte[]) -> getByte()引发的不一致问题

    今天接短信接口,短信接口提供了sdk,我们可以直接用sdk发送请求然后发送对应短信. 但是想使用我们平台自定义的httpUtil实现. 然而忙了1天半,才解决这个问题,还是我同事帮忙找出问题并解决的. ...

  6. SharePoint online Multilingual support - Development(1)

    博客地址:http://blog.csdn.net/FoxDave 上一节讲了SharePoint Online网站多语言的实现原理机制,本节主要从编程的角度来谈一下如何进行相关的设置. 下面列出 ...

  7. SpringMVC学习四(@ModelMap @RequestBody等等的说明)

    参考如下 http://www.cnblogs.com/HD/p/4107674.html http://www.cnblogs.com/qiankun-site/p/5774325.html @re ...

  8. yum配置Linux的Web服务器

    1.打开终端:输入su -root用于切换至root用户,目的是为了取得权限2.安装步骤如下(1)安装文件[root@localhost ~]# yum -y install httpd.i686[r ...

  9. reset.css 文件

    body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,b ...

  10. Vue 之 Vue.nextTick()

    异步更新队列 可能你还没有注意到,Vue 异步执行 DOM 更新.只要观察到数据变化,Vue 将开启一个队列,并缓冲在同一事件循环中发生的所有数据改变.如果同一个 watcher 被多次触发,只会一次 ...