目前我正通过Prometheus.io监控码头集装箱.我的问题是我只是得到"cpu_user_seconds_total"或"cpu_system_seconds_total".我的问题是如何将这个不断增加的值转换为CPU百分比?
目前我在查询:
rate(container_cpu_user_seconds_total[30s])
Run Code Online (Sandbox Code Playgroud)
但我不认为它是正确的(与顶部相比).
如何将cpu_user_seconds_total转换为CPU百分比?(就像在顶部)
有没有办法按度量标准名称对应用程序的所有指标进行分组?查询的一部分,列出了应用的所有指标(即{app="bar"}):
ch_qos_logback_core_Appender_all_total{affiliation="foo",app="bar", instance="baz-3-dasp",job="kubernetes-service-endpoints",kubernetes_name="bar",kubernetes_namespace="foobarz",kubernetes_node="mypaas-dev-node3.fud.com",updatedBy="janedoe"} 44
ch_qos_logback_core_Appender_debug_total{affiliation="foo",app="bar", instance="baz-3-dasp",job="kubernetes-service-endpoints",kubernetes_name="bar",kubernetes_namespace="foobarz",kubernetes_node="mypaas-dev-node23.fud.com",updatedBy="deppba"} 32
Run Code Online (Sandbox Code Playgroud)
我也尝试在度量标准名称中使用通配符,prometheus正在抱怨这一点.查看指标,我可以看到其中一些具有动态名称,最有可能通过dropwizard指标提供.我最终想要的是所有可用指标的列表.
I'm trying to configure Prometheus and Grafana with my Hyperledger fabric v1.4 network to analyze the peer and chaincode mertics. I've mapped peer container's port 9443 to my host machine's port 9443 after following this documentation. I've also changed the provider entry to prometheus under metrics section in core.yml of peer. I've configured prometheus and grafana in docker-compose.yml in the following way.
prometheus:
image: prom/prometheus:v2.6.1
container_name: prometheus
volumes:
- ./prometheus/:/etc/prometheus/
- prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/etc/prometheus/console_libraries' …Run Code Online (Sandbox Code Playgroud) 我想监控集群中持久卷的磁盘使用情况。我正在使用CoreOS Kube Prometheus。仪表板正在尝试使用名为kubelet_volume_stats_capacity_bytes的指标进行查询,该指标从 v1.12 开始的 Kubernetes 版本不再可用。
我正在使用 Kubernetes 版本 v1.13.4 和hostpath-provisioner根据持久卷声明来配置卷。我想访问每个持久卷的当前磁盘使用指标。
kube_persistentvolumeclaim_resource_requests_storage_bytes可用,但它仅以字节为单位显示持久声明请求
container_fs_usage_bytes没有完全涵盖我的问题。
metrics kubernetes prometheus persistent-volumes kubernetes-pvc
我正在使用 Prometheus 2.9.2 来监控大型节点环境。作为在我们的环境中测试 Prometheus 最大规模的一部分,我在我们的测试环境上模拟了大量指标。
我的管理服务器有 16GB 内存和 100GB 磁盘空间。
在规模测试期间,我注意到 Prometheus 进程消耗越来越多的内存,直到进程崩溃。
我注意到 WAL 目录很快就被大量数据文件填满,而 Prometheus 的内存使用量却在上升。
管理服务器每15秒抓取一次节点,存储参数全部设置为默认值。
我想知道为什么会发生这种情况,以及如何/是否可以防止进程崩溃。
谢谢你!
我已经读过Spark没有Prometheus作为预包装的水槽之一.所以我发现这篇关于如何使用prometheus监控Apache Spark的帖子.
但我发现很难理解和成功,因为我是初学者,这是第一次使用Apache Spark.
我不能得到的第一件事是我需要做什么?
我需要更改metrics.properties
我应该在应用程序中添加一些代码还是?
我没有得到它的步骤...
我正在做的事情是:更改链接中的属性,编写此命令:
Run Code Online (Sandbox Code Playgroud)--conf spark.metrics.conf=<path_to_the_file>/metrics.properties
还有什么我需要做的来看看Apache spark的指标?
我还发现了这个链接: 使用Prometheus监控Apache Spark
https://argus-sec.com/monitoring-spark-prometheus/
但我也无法用它做到......
我已经读过有一种方法可以从Graphite获取指标,然后将它们导出到Prometheus,但我找不到一些有用的文档.
我查看了prometheus-cpp中的语法示例和主要 prometheus 文档中非常相似的 go one,但我不确定我应该如何在我的 C++ 应用程序中使用类似的代码。Go 使用全局变量来保存计数器,C++ 在检测函数中使用本地引用。自动引用意味着我不能轻易地将计数器放入包装器中,但是每次我想增加一个计数器时都需要 10 行的开销是不可接受的。
天真的它看起来像这样:
void SomeClass::a_little_method() {
auto start = get_accurate_time();
// actual code that the method
// uses to do whatever it does
// in less than ten lines of code
auto& counter_family = BuildCounter()
.Name("little_method")
.Help("little method execution count and duration")
.Labels({
{"My Application", "metrics"}
})
.Register(*global_registry_pointer);
auto& call_counter = counter_family.Add({
{"calls", "count"}
});
auto& execution_timer = counter_family.Add({
{"calls", "duration"}
});
call_counter.Increment();
execution_timer.Increment(get_accurate_time() - …Run Code Online (Sandbox Code Playgroud) Prometheus 在docker容器(版本 18.09.2,构建 6247962,docker-compose.xml如下)中运行,并且刮取目标是localhost:8000由 Python 3 脚本创建的。
为失败的抓取目标 ( localhost:9090/targets)获得的错误是
获取http://127.0.0.1:8000/metrics:拨号 tcp 127.0.0.1:8000:getsockopt:连接被拒绝
问题:为什么 docker 容器中的 Prometheus 无法抓取在主机(Mac OS X)上运行的目标?我们如何让在 docker 容器中运行的 Prometheus 能够抓取在主机上运行的目标?
失败的尝试:尝试替换docker-compose.yml
networks:
- back-tier
- front-tier
Run Code Online (Sandbox Code Playgroud)
和
network_mode: "host"
Run Code Online (Sandbox Code Playgroud)
但随后我们无法访问 Prometheus 管理页面localhost:9090。
无法从类似问题中找到解决方案
docker-compose.yml
version: '3.3'
networks:
front-tier:
back-tier:
services:
prometheus:
image: prom/prometheus:v2.1.0
volumes:
- ./prometheus/prometheus:/etc/prometheus/
- ./prometheus/prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- …Run Code Online (Sandbox Code Playgroud) 我有一个应用程序,当它收到一个特定的 HTTP 请求时,它会增加一个 Prometheus 计数器。该应用程序在 Kubernetes 中运行,具有多个实例并且每天重新部署多次。使用查询http_requests_total{method="POST",path="/resource/aaa",statusClass="2XX"}生成一个图表,按预期显示每个实例的累积请求计数。
我想创建一个 Grafana 图,显示过去 7 天内收到的请求的累积频率。
我的第一个想法是increase(...[7d])为了考虑 7 天窗口之外的任何指标(如图所示),然后sum是这些值。
我已经意识到sum(increase(http_requests_total{method="POST",path="/resource/aaa",statusClass="2XX"}[7d]))事实上确实给出了时间点的正确答案。然而,生成的图表并不完全符合要求,因为组件increase(...) 值会随着一周而增加/减少。
我将如何创建一个图表来显示过去 7 天内这些指标增加的累积总和?例如,给定以下简化数据
| Day | # Requests |
|-----|------------|
| 1 | 10 |
| 2 | 5 |
| 3 | 15 |
| 4 | 10 |
| 5 | 20 |
| 6 | 5 |
| 7 | 5 |
| …Run Code Online (Sandbox Code Playgroud) 我尝试在我的 Kubernetes VM 上获取 Total 和 Free 磁盘空间,以便我可以在其上显示占用空间的百分比。我尝试了名称中包含“文件系统”的各种指标,但没有一个显示正确的总磁盘大小。应该使用哪一个来做到这一点?
这是我尝试过的指标列表
node_filesystem_size_bytes
node_filesystem_avail_bytes
node:node_filesystem_usage:
node:node_filesystem_avail:
node_filesystem_files
node_filesystem_files_free
node_filesystem_free_bytes
node_filesystem_readonly
Run Code Online (Sandbox Code Playgroud) prometheus ×10
docker ×2
grafana ×2
kubernetes ×2
apache-spark ×1
c++ ×1
cpu-usage ×1
java ×1
memory ×1
metrics ×1
monitoring ×1
performance ×1
promql ×1