Prometheus

优化:在k8s上部署的gitlab

倖福魔咒の 提交于 2020-07-27 03:51:23
gitlab组件图 gitlab在k8s上占用资源 # kubectl top pods -n default | grep git* gitlab-gitaly-0 9m 444Mi gitlab-gitlab-exporter-59c6bdb69c-gz9nf 5m 36Mi gitlab-gitlab-shell-547cc48d99-kmrbp 10m 21Mi gitlab-gitlab-shell-547cc48d99-szg74 8m 25Mi gitlab-minio-5746f7f7c7-tdff5 0m 47Mi gitlab-prometheus-server-7d8bcf896d-vm5kq 14m 650Mi gitlab-redis-cd6b45457-2s4cg 9m 17Mi gitlab-registry-6c5df4646f-mbdkr 0m 15Mi gitlab-registry-6c5df4646f-mqkxl 0m 31Mi gitlab-sidekiq-all-in-1-576d89544d-8swmw 28m 967Mi gitlab-unicorn-68f8f8d8d9-6clpv 8m 1510Mi gitlab-unicorn-68f8f8d8d9-xbt8j 10m 1522Mi gitlab组件简介 对比kubectl

生产环境Kubernetes Consul最佳实践

最后都变了- 提交于 2020-07-27 00:13:58
生产环境Kubernetes Consul最佳实践 本指南为Consul agent在K8s中的运行方式,Server端建议运行在物理机上。 Consul的安装方式请参考本人的另一篇博文 Consul集群安装 ,这里不做过多描述。 本方案已在生产环境中经过验证,暂时没有发现使用问题。 Kubernetes中运行Consul agent的问题及应对方法 问题 业务如何去连接Consul agent。(Consul有一个特性为从哪台客户端注册的服务就要从哪台客户端反注销)。 Consul agent启动的时候会根据主机名、IP等信息在data目录下生成自己的node-id等元数据。如果未持久化data目录,未使用主机网络,当Pod更新的时候,主机名和IP地址会改变。导致在Consul中出现同一个IP地址对应两个主机名的情况。服务注册就会出现问题。 第2中情况在生产环境中已遇到多次,同事更改了主机名称就导致在Consul集群中同一个IP对应两个主机名的情况。导致服务运行异常。 解决方法 Consul-agent以DaemonSet的方式运行,通过使用主机网络(hostNetwork)。保持主机名和IP地址不变。将Consul的元数据持久化到宿主机的目录,这样Consul更新的时候,重新读取这个目录。不会重新生成node-id等元数据。

.Net Core服务监控报警指标上报Prometheus+Grafana

左心房为你撑大大i 提交于 2020-07-25 19:44:01
前言 简单集成Prometheus+Grafana,指标的上报收集可视化。 Prometheus Prometheus 是一个监控平台,监控从HTTP端口收集受监控目标的指标。在微服务的架构里 Prometheus 多维度的数据收集是非常强大的 我们首先下载安装 Prometheus 和 node_exporter , node_exporter 用于监控CPU、内存、磁盘、I/O等信息 Prometheus下载地址 node_exporter下载地址 下载完成后解压以管理员运行 prometheus.exe 访问 http://localhost:9090/ 出现一下页面说明启动成功啦 .Net Core获取指标 有了 Prometheus ,我们还需要给 Prometheus 提供获取监控数据的接口,我们新建一个WebApi项目,并导入 prometheus-net.AspNetCore 包,在 Configure 中加入 UseMetricServer 中间件 public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { app.UseMetricServer(); } 启动项目访问 http://localhost:5000/metrics 就可以看基本的一些监控信息啦,包括线程数,句柄数

打造云原生大型分布式监控系统(三):Thanos 部署与实践

非 Y 不嫁゛ 提交于 2020-07-25 05:00:38
上一篇《 Thanos 架构详解 》我们深入理解了 Thanos 的架构设计与实现原理,现在我们来聊聊实战,分享一下如何部署和使用 Thanos。 部署方式 本文聚焦 Thanos 的云原生部署方式,充分利用 Kubernetes 的资源调度与动态扩容能力。从官方可以看到,当前 Thanos 在 Kubernetes 上部署有以下三种: prometheus-operator[1]:集群中安装了 prometheus-operator 后,就可以通过创建 CRD 对象来部署 Thanos 了。 社区贡献的一些 Helm Charts[2]:很多个版本,目标都是能够使用 Helm 来一键部署 Thanos。 kube-thanos[3]:Thanos 官方的开源项目,包含部署 Thanos 到 Kubernetes 的 Jsonnet 模板与 yaml 示例。 本文将使用基于 kube-thanos 提供的 yaml 示例(examples/all/manifests)来部署,原因是 prometheus-operator 与社区的 Helm Chart 方式部署多了一层封装,屏蔽了许多细节,并且它们的实现都还不太成熟;直接使用 Kubernetes 的 yaml 资源文件部署更直观,也更容易做自定义,而且我相信使用 Thanos 的用户通常都是高玩了,也有必要对 Thanos

阿里云发布新一代容器、Serverless等云原生产品,加速企业向现代IT架构演进

偶尔善良 提交于 2020-07-24 21:46:01
在6月9日2020阿里云线上峰会上,云原生应用平台产品总监赵林(丹臣)发表了《云原生2020新产品发布 传统应用架构往现代应用架构快速演进的基础设施》的主题演讲,详细介绍了阿里云全新发布的容器、中间件、Serverless等产品。随着数字经济的快速发展和扩张,越来越多的企业开始采用云原生计算的思想和技术,以主导企业的数字化转型架构。 新产品发布和解决方案升级,助力企业从传统IT架构向现代应用架构演进 云原生的技术和产品,可以帮助用户轻松地从原有的 IT 架构向现代应用架构演进。从底层应用托管平台来看,阿里云提供了容器服务ACK/ASK。在应用PaaS层,阿里云提供了SAE、EDAS、Web+三款产品。在上层,阿里云提供了函数FaaS服务,可以满足不同的业务需求。不仅如此,阿里云还提供了各种各样的中间件服务,包括业界最为完整丰富的消息队列服务,覆盖了所有常见的消息协议,如国内著名的开源消息中间件产品RocketMQ、业界流行的Kafka,AMQP/MQTT 消息队列都可以在阿里云上找到对应的商业化服务。在其它中间件领域,如微服务引擎MSE、应用配置管理ACM、云服务总线CSB,以及针对事务服务的GTS等,都可以帮助企业用户快速构建现代化的应用架构。 阿里云之所以提供如此丰富全面的云原生技术和产品,核心还是要满足客户多样化的需求。 除了应用托管平台以及常见的中间件之外

prometheus rate on series by regex

我与影子孤独终老i 提交于 2020-07-22 06:27:20
问题 I am using the following query to get some metrics based on the name: {__name__=~"bus_listener.+_processed"} There are multiple metrics that match this name and multiple apps are publishing these metrics. I am trying to calculate a rate on this, with: rate({__name__=~"bus_listener.+_processed"}[5m]) But this gives me the following error: vector cannot contain metrics with the same labelset I cannot use recording metrics, I only have access to grafana, which reads metrics from prometheus. How

Monitoring short lived python Batch Job Processes using Prometheus

痴心易碎 提交于 2020-06-27 17:45:28
问题 How can I monitor my python processes (say some script that gets triggered periodically by Cron daemon) using Prometheus? Note that this is not a web application but a short-lived process that gets launched periodically by the Cron daemon. This script comes up, does its job, and terminates. The same python script gets launched multiple times a day (approximately 100k times) by cron daemon. I want to capture multiple stats from various runs of this script (for example, the time it takes to run

Prometheus config doesn't work with Spring boot 2.3.0: ClassNotFoundException: io.micrometer.prometheus.HistogramFlavor

北战南征 提交于 2020-06-17 00:09:32
问题 Application was working correctly with version 2.2.6 but as the application is upgraded to latest version of spring boot 2.3.0 it stopped working and fails during startup. 2020-05-20T08:43:04.408+01:00 [APP/PROC/WEB/0] [OUT] 2020-05-20 07:43:04.407 ERROR 15 --- [ main] o.s.b.web.embedded.tomcat.TomcatStarter : Error starting Tomcat context. Exception: org.springframework.beans.factory.UnsatisfiedDependencyException. Message: Error creating bean with name 'webMvcMetricsFilter' defined in class

Prometheus config doesn't work with Spring boot 2.3.0: ClassNotFoundException: io.micrometer.prometheus.HistogramFlavor

≡放荡痞女 提交于 2020-06-17 00:09:05
问题 Application was working correctly with version 2.2.6 but as the application is upgraded to latest version of spring boot 2.3.0 it stopped working and fails during startup. 2020-05-20T08:43:04.408+01:00 [APP/PROC/WEB/0] [OUT] 2020-05-20 07:43:04.407 ERROR 15 --- [ main] o.s.b.web.embedded.tomcat.TomcatStarter : Error starting Tomcat context. Exception: org.springframework.beans.factory.UnsatisfiedDependencyException. Message: Error creating bean with name 'webMvcMetricsFilter' defined in class

Prometheus config doesn't work with Spring boot 2.3.0: ClassNotFoundException: io.micrometer.prometheus.HistogramFlavor

限于喜欢 提交于 2020-06-17 00:08:38
问题 Application was working correctly with version 2.2.6 but as the application is upgraded to latest version of spring boot 2.3.0 it stopped working and fails during startup. 2020-05-20T08:43:04.408+01:00 [APP/PROC/WEB/0] [OUT] 2020-05-20 07:43:04.407 ERROR 15 --- [ main] o.s.b.web.embedded.tomcat.TomcatStarter : Error starting Tomcat context. Exception: org.springframework.beans.factory.UnsatisfiedDependencyException. Message: Error creating bean with name 'webMvcMetricsFilter' defined in class