Prometheus

prometheus — nginx-vts-exporter

守給你的承諾、 提交于 2021-02-11 13:08:47
参考文档: https://blog.51cto.com/xujpxm/2080146 注: 本文留用自己参考,建议看以上参考文档,更为细致 prometheus 监控 nginx 使用 nginx-vts-exporter 采集数据。同时,需要 nginx 支持 nginx-module-vts 模块获取 nginx 自身的一些数据。 #nginx 的模块支持 进入nginx 安装包解压后的目录,下载模块文件 git clone git://github.com/vozlt/nginx-module-vts.git 编译安装,只需要在之前的编译参数中加上 --add-module=/path/to/nginx-module-vts 即可 ./configure --prefix=/usr/local/nginx --sbin-path=/usr/local/nginx/sbin/nginx --conf-path=/usr/local/nginx/conf/nginx.conf --user=nginx --group=nginx --add-module=./nginx-module-vts make && make install 修改nginx 配置 http { vhost_traffic_status_zone; vhost_traffic_status_filter

PromQL avg_over_time for non-zero values

泪湿孤枕 提交于 2021-02-11 08:42:08
问题 I am trying to get avg_over_time value from gauge metric, but I would want average only from the non-zero values of the metric (or values higher than zero, to be exact). Example: avg_over_time(foo[2d] > 0) But I alwas get parse error: binary expression must contain only scalar and instant vector types I tried setting up recording rule expr: foo > 0 But unfortunately with the same result. Is this possible in PromQL? 回答1: You can use a sub-query with Prometheus version above 2.7: avg_over_time(

PromQL avg_over_time for non-zero values

眉间皱痕 提交于 2021-02-11 08:41:51
问题 I am trying to get avg_over_time value from gauge metric, but I would want average only from the non-zero values of the metric (or values higher than zero, to be exact). Example: avg_over_time(foo[2d] > 0) But I alwas get parse error: binary expression must contain only scalar and instant vector types I tried setting up recording rule expr: foo > 0 But unfortunately with the same result. Is this possible in PromQL? 回答1: You can use a sub-query with Prometheus version above 2.7: avg_over_time(

Service Mesh对比:Istio与Linkerd

纵饮孤独 提交于 2021-02-11 05:39:28
根据CNCF的最新年度调查,很多组织对Service Mesh表现出很高的兴趣,并且有一部分已经在生产环境中使用它们。你可能不知道Linkerd是市场上第一个Service Mesh,但是Istio使Service Mesh更受欢迎。这两个项目都是最前沿的项目,而且竞争非常激烈,因此很难选择一个项目。 在本篇文章中,我们将和你一起了解Istio和Linkerd架构,组件,并比较它们的产品以帮助你做出明智的决定。 Service Mesh简介 在过去的几年中,微服务架构已成为软件设计中流行的样式。在这种架构中,我们将应用程序分解为可独立部署的服务。这些服务通常是轻量级的,多语言的,并且通常由各种职能团队进行开发部署。 当某些服务数量增加,难以管理且越来越复杂时,微服务架构将一直有效。但这也在管理安全性,网络流量控制和可观察性等各个方面带来了挑战。 Service Mesh可以很好地帮助应对这些挑战。 Service Mesh 用于描述组成应用程序的微服务及其之间的交互。随着服务数量的增加和复杂性的增加,扩展和管理变得越来越困难。Service Mesh可以为微服务架构提供服务发现,负载均衡,故障恢复,指标和监视。 Service Mesh 通常还能够满足更复杂的需求,例如A/B测试,金丝雀发布,速率限制,访问控制和端到端身份验证。 Service Mesh

Prometheus query to count unique labels over a timeframe

冷暖自知 提交于 2021-02-08 19:53:10
问题 I need to count the number of unique labelsets for a prometheus metric over a given timeframe. For example, "How many unique labelsets have a value of 1 at some point during the past 7 days." I've investigated using count and count_over_time but count only operates on instant vectors meaning I can get the number of unique labelsets for an instance in time, but not in aggregate over a timeframe. count_over_time returns the number of values which isn't useful since I need to know the number of

Prometheus query to count unique labels over a timeframe

不羁岁月 提交于 2021-02-08 19:52:45
问题 I need to count the number of unique labelsets for a prometheus metric over a given timeframe. For example, "How many unique labelsets have a value of 1 at some point during the past 7 days." I've investigated using count and count_over_time but count only operates on instant vectors meaning I can get the number of unique labelsets for an instance in time, but not in aggregate over a timeframe. count_over_time returns the number of values which isn't useful since I need to know the number of

Spring Cloud Data Flow Grafana Prometheus not showing stream data

江枫思渺然 提交于 2021-02-08 15:12:38
问题 I launch Spring cloud data flow with docker-compose base on this website. https://dataflow.spring.io/docs/installation/local/docker/ I created 3 apps, Source, Processor & Sink. I ran export STREAM_APPS_URI=https://dataflow.spring.io/Einstein-BUILD-SNAPSHOT-stream-applications-kafka-maven When I run docker-compose -f ./docker-compose.yml -f ./docker-compose-prometheus.yml up, all my containers start up as specified in the docker-compose.yml and docker-compose-prometheus.yml. I proceed to

Spring Cloud Data Flow Grafana Prometheus not showing stream data

情到浓时终转凉″ 提交于 2021-02-08 15:12:06
问题 I launch Spring cloud data flow with docker-compose base on this website. https://dataflow.spring.io/docs/installation/local/docker/ I created 3 apps, Source, Processor & Sink. I ran export STREAM_APPS_URI=https://dataflow.spring.io/Einstein-BUILD-SNAPSHOT-stream-applications-kafka-maven When I run docker-compose -f ./docker-compose.yml -f ./docker-compose-prometheus.yml up, all my containers start up as specified in the docker-compose.yml and docker-compose-prometheus.yml. I proceed to

Cannot find data in Prometheus with InfluxDB remote write/read api

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-08 10:22:17
问题 InfluxDB announced Prometheus remote write/read api in ver1.4. https://docs.influxdata.com/influxdb/v1.4/supported_protocols/prometheus/ https://www.influxdata.com/blog/influxdb-now-supports-prometheus-remote-read-write-natively/ I have deployed a new InfluxDB, created a user called "paul" with password 'foo', created a database called "prometheus" and filled with sample data: Then, I modified the config yml of Prometheus (I found the '*' in influx doc example should be replaced by '-') I

How to divide after grouping two different metrics in Prometheus?

情到浓时终转凉″ 提交于 2021-02-08 03:40:48
问题 I'm currently trying to alert on Kubernetes pods stacking within an availability zone. I've managed to use two different metrics to the point where I can see how many pods for an application are running on a specific availability zone. However, due to scaling, I want the alert to be percentage based...so we can alert when a specific percentage of pods are running on one AZ (i.e. over 70%). My current query: sum(count(kube_pod_info{namespace="somenamespace", created_by_kind="StatefulSet"}) by