prometheus-exporter-collector's People
Forkers
lts120784620 wandering-swordsman isgasho laiwei topjs lifehacking hotspring-zwb callmedba china-bigcloud youtwo123 liuxiankun wanglei1004 chaoyang-ops datayuan king3379 laashub-soa zhuangyang chixianlianggithub cxlstudyroad jamesjoe-c qinlikang pidouzi xujianming2017 csh3323 khw934 xroa shangzhiliang lincolnhuangprometheus-exporter-collector's Issues
请问具体一点的过程是什么?通过Nightingale插件采集,collector采集目标exporter指标并上报
parse metrics result error: json: unsupported value: NaN
parse metrics result error: json: unsupported value: NaN
What's the problem?
[需求]prometheus-exporter-collector支持prometheus查询语法
需求描述:
prometheus-exporter-collector支持prometheus查询语法
需求背景:
如果将prometheus 切到prometheus-exporter-collector,好多图表展示就用不了,建议在适当情况兼容这种场景,应该大多数会遇到这种情况,大部分容器和虚拟机监控用的prometheus+grafana
影响:
弊:
当前未支持将影响原生使用prometheus+grafana用户,需要与n9e做技术妥协,带来高额维护成本;
不利于运维监控体系构建完整性;
利:
实现后,将完美与prometheus结合,提高n9e监控覆盖率;
有效降低运维监控维护成本;
对n9e来说,将吸引一大批想要真正迁移到n9e的潜在用户,提升该开源项目知名度;
json: cannot unmarshal string into Go struct field MetricValue.tags of type map[string]string
1、通过prometheus-exporter-collector收集的数据如下
[{
"metric": "redis_commands_processed_total",
"endpoint": "127.0.0.1",
"timestamp": 1631013680,
"step": 0,
"value": 1970,
"counterType": "COUNTER",
"tags": "aaa=hellw,dept=cloud",
"tagsMap": {},
"extra": ""
},
{
"metric": "redis_memory_used_peak_bytes",
"endpoint": "127.0.0.1",
"timestamp": 1631013680,
"step": 0,
"value": 813360,
"counterType": "GAUGE",
"tags": "aaa=hellw,dept=cloud",
"tagsMap": {},
"extra": ""
}
]
2、server端的日志却提示tags是map格式,这个是已知问题吗?
json: cannot unmarshal string into Go struct field MetricValue.tags of type map[string]string
go build报错
[root@MiWiFi-R3P-srv prometheus-collector]# go build
main.go:12:2: cannot find package "github.com/didi/nightingale/src/dataobj" in any of:
/usr/local/go/src/github.com/didi/nightingale/src/dataobj (from $GOROOT)
/root/go/src/github.com/didi/nightingale/src/dataobj (from $GOPATH)
main.go:13:2: cannot find package "github.com/n9e/prometheus-exporter-collector/collector" in any of:
/usr/local/go/src/github.com/n9e/prometheus-exporter-collector/collector (from $GOROOT)
/root/go/src/github.com/n9e/prometheus-exporter-collector/collector (from $GOPATH)
main.go:14:2: cannot find package "github.com/n9e/prometheus-exporter-collector/config" in any of:
/usr/local/go/src/github.com/n9e/prometheus-exporter-collector/config (from $GOROOT)
/root/go/src/github.com/n9e/prometheus-exporter-collector/config (from $GOPATH)
main.go:15:2: cannot find package "github.com/n9e/prometheus-exporter-collector/model" in any of:
/usr/local/go/src/github.com/n9e/prometheus-exporter-collector/model (from $GOROOT)
/root/go/src/github.com/n9e/prometheus-exporter-collector/model (from $GOPATH)
main.go:16:2: cannot find package "github.com/open-falcon/falcon-plus/common/model" in any of:
/usr/local/go/src/github.com/open-falcon/falcon-plus/common/model (from $GOROOT)
/root/go/src/github.com/open-falcon/falcon-plus/common/model (from $GOPATH)
执行 cat plugin.test.json |./prometheus-exporter-collector 报错
cat plugin.test.json |./prometheus-exporter-collector
Segmentation fault
第三方多平台接入prometheus-exporter报路径错误
项目维护状态咨询
这个项目现在是不维护了吗
我想使用这个程序采集prometheus指标推给open-falcon,是否可行呢
为什么采集到的value值都是0
使用 -s 60
cat template.json | ./prometheus-exporter-collector -s 60
step 还是0 60不生效
按照相关的启动没有收集到信息
prometheus-exporter-collector多节点采集时只采集最后一个节点的问题
问题已经定位,collector目录下gather.go文件Gather()
测试了四节点和两节点的,都存在这个问题,一下为两节点的例子。
`func Gather() []*dataobj.MetricValue {
var wg sync.WaitGroup
var res []*dataobj.MetricValue
cfg := config.Get()
metricChan := make(chan *dataobj.MetricValue)
done := make(chan struct{}, 1)
go func() {
defer func() { done <- struct{}{} }()
for m := range metricChan {
res = append(res, m)
}
}()
for _, url := range cfg.ExporterUrls {
fmt.Println("out :", url)
wg.Add(1)
go func() {
defer wg.Done()
if metrics, err := gatherExporter(url); err == nil {
fmt.Println("in :", url)
for _, m := range metrics {
if typ, exists := cfg.MetricType[m.Metric]; exists {
m.CounterType = typ
}
if cfg.MetricPrefix != "" {
m.Metric = cfg.MetricPrefix + m.Metric
}
metricChan <- m
}
}
}()
// time.Sleep(2 * time.Second)
}
wg.Wait()
close(metricChan)
<-done
return res
}`
这是测试过程,加了fmt.Println("out :", url)和fmt.Println("in :", url)以及// time.Sleep(2 * time.Second)三行代码
`[root@master prometheus-exporter-collector]# cat plugin.test.json | ./prometheus-exporter-collector
out : http://192.168.84.13:9001/metrics
in : http://192.168.84.13:9001/metrics
out : http://192.168.84.9:9001/metrics
in : http://192.168.84.9:9001/metrics
[root@master prometheus-exporter-collector]#
[root@master prometheus-exporter-collector]#
[root@master prometheus-exporter-collector]# cat plugin.test.json | ./prometheus-exporter-collector
out : http://192.168.84.13:9001/metrics
out : http://192.168.84.9:9001/metrics
in : http://192.168.84.9:9001/metrics
in : http://192.168.84.9:9001/metrics
[root@master prometheus-exporter-collector]#
`
测试结果为,上面测试结果为加了两秒延迟的结果,为我们的期待结果,下面的测试结果为没有加延迟的结果,只采集到了最后一个节点。应该是创建线程需要时间,直接跳过了,也可能是解释器优化掉了。反正就是两个线程的参数一样而导致只能获取同一节点数据。
已经证实的解决方案:
1.加延迟(性能低,1s测试不行,主要是本人测试环境延迟高)
2.修改机制,不采用多线程获取一个节点监控数据,直接一个进程获取到所有节点监控数据
具体操作为gatherExporter()函数直接传入数组,在其内部循环获取各个节点数据。
3.多插件机制,即每个插件只监控一个节点。
你好这样配置为啥采集不到数据,但是手动测试是可以的
请问下是不是只是支持采集node-exporter,但是不支持复杂计算类似rate()
parse metrics result error: json: unsupported value: +Inf
I want to use n9e to monitor TiDB,but the prometheus-exporter-collector plugin can't parse TiFlash metrics,see error log in the follow
less /data/n9e/logs/agentd/ERROR.log
ERROR plugins/scheduler.go:111 exec /data/n9e/plugins/prometheus-exporter-collector fail: 2021/10/20 16:02:33 parse metrics result error: json: unsupported value: +Inf
curl http://127.0.0.1:8234/metrics|grep +Inf
tiflash_storage_logical_throughput_bytes_sum{type="read"} +Inf
the +inf
is out of the json format,so the prometheus-exporter-collector plugin can't parse the other metrics,how to resove this problem?
上报到openfalcon之后,有采集到数据,但没有曲线图表显示
下方有last的数值,但一直不显示曲线
WARNING core/push.go:35...err:tag key and value should not be empty
环境:
夜莺版本3.3.1
问题描述:
没有收集到mysql_slave_status相关指标
夜莺插件采集配置:
{
"exporter_urls": ["http://127.0.0.1:9104/metrics"],
"append_tags": [
"region=zyybj",
"dept=ops",
"exporter_port=9104",
"mysql_port=3306"
],
"endpoint": "",
"ignore_metrics_prefix": ["go_"],
"metric_prefix": "",
"metric_type": {
"mysql_global_status_connections":"SUBTRACT"
},
"default_mapping_metric_type": "SUBTRACT",
"timeout": 1000
}
agent报错信息:
2020-12-21 13:34:09.773894 WARNING core/push.go:35 metric:&{ mysql_slave_status_exec_master_log_pos 192.168.18.32 1608528849 60 3.9652926e+07 0 GAUGE channel_name=,connection_name=,dept=ops,exporter_port=9104,master_host=192.168.18.31,master_uuid=ea29fa07-bcd6-11ea-b794-005056aed2e9,mysql_port=3306,region=zyybj map[channel_name: dept:ops exporter_port:9104 master_host:192.168.18.31 master_uuid:ea29fa07-bcd6-11ea-b794-005056aed2e9 mysql_port:3306 region:zyybj] } err:tag key and value should not be empty
能拉去springcloud的监控指标吗
这块刚试用,想了解一下,
下载mod报错
目前只支持endpoint不支持nid 形式上报数据
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.