我尝试从普罗米修斯获取这些测量值:
increase(http_server_requests_seconds_count{uri="myURI"}[10s])increase(http_server_requests_seconds_count{uri="myURI"}[30s])rate(http_server_requests_seconds_count{uri="myURI"}[10s])rate(http_server_requests_seconds_count{uri="myURI"}[30s])然后我运行一个 python 脚本,其中创建了 5 个线程,每个线程都访问此 myURI 端点:
我在 Grafana 上看到的是:
我收到了这些值:
我预计会收到这些(但没有):
有人可以用我的例子解释这个函数背后的公式以及实现我期望的指标/值的方法吗?
我没有找到"移动平均"功能,我想知道是否有解决方法.
我正在使用Influxdb作为后端.
我在Cloud Foundry上运行了一个Spring Boot应用程序,它分别通过/ metrics和/ health端点公开指标和健康信息.我想将这些指标作为连续流发布到flowfDB用户提供的服务,以便在grafana仪表板上进行可视化.我正在寻找解释数据流如何工作的任何资源,并希望得到任何建议.
谢谢.
我有以下指标:
folsomite.<host>.cache.hit1folsomite.<host>.cache.hit2folsomite.<host>.cache.miss1folsomite.<host>.cache.miss2folsomite.<host>.cache.miss3(我正在使用的缓存库有2种命中:第一次机会和第二次机会,以及3种口味的错过)
我想算一算(hit1 + hit2) / (miss1 + miss2 + miss3).我以为我会从计算开始(hit1 + hit2),但如果我使用sumSeriesas sumSeries(folsomite.*.cache.hit*),那么它<host>也会对值进行求和.
如何在一些通配符上汇总多个指标,而不是对其他通配符进行求和?或者我如何在保留通配符的同时专门添加两个(或更多指标)?
并且,在完成此操作后,我可以将一个(求和)结果除以另一个吗?
编辑:我实际上是使用grafana来渲染图形.这有什么区别吗?
我以前经历过使用Kibana.不过这一次,我想尝试使用Grafana.我的经验能保证我能轻松学习Grafana吗?或者与Kibana有很大的不同?
如果我错了请纠正我,但到目前为止,根据我的研究,两者都是日志.Grafana更像是可视化,而Kibana则用于搜索日志; 这是正确的吗?
我有一个充满价值的Influx数据库.这些值由Grafana提供.我需要的是根据选定的时间间隔获取实际值.
目前,我对单个指标有以下查询:
SELECT mean("value") FROM "table" WHERE $timeFilter GROUP BY time($interval) fill(null)
Run Code Online (Sandbox Code Playgroud)
我想要的是从该间隔中减去最低值,因此它只计算该间隔内的值.因此图表需要从零开始.要从该间隔获得最低值,我使用:
SELECT min("value") FROM "table" WHERE $timeFilter
Run Code Online (Sandbox Code Playgroud)
所以我认为将这两个(使用子查询)组合起来应该可行:
SELECT mean("value") - (SELECT min("value") FROM "table" WHERE $timeFilter) FROM "table" WHERE $timeFilter GROUP BY time($interval) fill(null)
Run Code Online (Sandbox Code Playgroud)
不幸的是,这不起作用.该查询不被接受为子查询.
我想计算一些独特的标签值.有一些像
select count (distinct a) from hello_info
Run Code Online (Sandbox Code Playgroud)
例如,如果我的度量标准'hello_info'具有标签a和b.我想要计算一个独特的数量.对于a ="1","2","3",计数将为3.
hello_info(a="1", b="ddd")
hello_info(a="2", b="eee")
hello_info(a="1", b="fff")
hello_info(a="3", b="ggg")
Run Code Online (Sandbox Code Playgroud) 我正在尝试了解掌舵,我想知道是否有人可以 ELI5 给我一些东西或帮助我做一些事情。
所以我确实在下面运行:
helm repo add coreos https://s3-eu-west-1.amazonaws.com/coreos-charts/stable/
Run Code Online (Sandbox Code Playgroud)
然后我使用以下方法安装了 kube-prometheus:
helm install coreos/kube-prometheus --name kube-prometheus -f values.yaml --namespace monitoringtest
Run Code Online (Sandbox Code Playgroud)
一切正常,但我正在尝试从 json 文件添加一些自定义仪表板,我正在努力理解如何做到这一点。
我正在关注这个: https://blogcodevalue.wordpress.com/2018/09/16/automate-grafana-dashboard-import-process/
在我的 values.yaml 中,我在下面添加了
serverDashboardConfigmaps:
- example-dashboards
Run Code Online (Sandbox Code Playgroud)
我明白,如果我这样做:
helm upgrade --install kube-prometheus -f values.yaml --namespace monitoringtest coreos/kube-prometheus
Run Code Online (Sandbox Code Playgroud)
这应该会导致 grafana 获取下面的 configmap 调用example-dashboards并从custom-dashboards文件夹加载 * .json文件。
apiVersion: v1
kind: ConfigMap
metadata:
name: example-dashboards
data:
{{ (.Files.Glob "custom-dashboards/*.json").AsConfig | indent 2 }}
# Or
#
# data:
# custom-dashboard.json: |-
# {{ (.Files.Get "custom.json") | …Run Code Online (Sandbox Code Playgroud) 我正在尝试向下面的掌舵图表添加一个新的仪表板
https://github.com/helm/charts/tree/master/stable/prometheus-operator
文档不是很清楚。
我已经向名称空间添加了一个配置映射,如下所示 -
apiVersion: v1
kind: ConfigMap
metadata:
name: sample-grafana-dashboard
namespace: monitoring
labels:
grafana_dashboard: "1"
data:
etcd-dashboard.json: |-
{JSON}
Run Code Online (Sandbox Code Playgroud)
根据文档,这应该只是“拾取”并添加,但不是。 https://github.com/helm/charts/tree/master/stable/grafana#configuration
我的 values.yaml 中的 sidecar 选项看起来像 -
grafana:
enabled: true
## Deploy default dashboards.
##
defaultDashboardsEnabled: true
adminPassword: password
ingress:
## If true, Grafana Ingress will be created
##
enabled: false
## Annotations for Grafana Ingress
##
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
## Labels to be added to the Ingress
##
labels: {}
## Hostnames. …Run Code Online (Sandbox Code Playgroud) 我一直试图让我的 Grafana 容器与我的反向代理一起工作,但没有成功。我尝试的一切只会导致“如果您看到此 Grafana 无法加载其应用程序文件”页面出现,无论我使用内部 IP 还是外部 URL 访问它。
到目前为止,我的 Docker Compose 在艺人中,请注意,现在没有使用这些环境变量,因此 #
version: '2'
services:
grafana:
image: grafana/grafana
hostname: grafana
container_name: grafana
network_mode: le_bridge
ports:
- 3000:3000
#environment:
#GF_SERVER_DOMAIN: 'myurl.ddns.net'
#GF_SERVER_ROOT_URL: 'https://myurl.ddns.net:443/grafana'
restart: unless-stopped
volumes:
- /Docker_Configs/grafana/config:/etc/grafana
- /Docker_Configs/grafana/data:/var/lib/grafana
Run Code Online (Sandbox Code Playgroud)
我的grafana.ini
[server]
domain = myurl.ddns.net
root_url = https://myurl.ddns.net/grafana/
Run Code Online (Sandbox Code Playgroud)
我的反向代理配置
location /grafana/{
include /config/nginx/proxy.conf;
proxy_pass http://192.168.2.13:3000/;
Run Code Online (Sandbox Code Playgroud) grafana ×10
influxdb ×3
prometheus ×2
configmap ×1
docker ×1
graphite ×1
kibana ×1
kubernetes ×1
metrics ×1
micrometer ×1
spring ×1
spring-boot ×1