Giter VIP home page Giter VIP logo

prometheus-exporter-collector's People

Contributors

710leo avatar laiwei avatar lts120784620 avatar ulricqin avatar zhuchunlai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

prometheus-exporter-collector's Issues

请问具体一点的过程是什么?通过Nightingale插件采集,collector采集目标exporter指标并上报

希望实现监控mysql的相关数据 请问具体一点操作过程是什么?
目前理解是使用prometheus-exporter-collector去读pormethues mysqld_exporter提供的数据并发送给agentd,agentd在发送给server
但是不知道如何查看效果

image

下面是prometheus-exporter-collector的路径,安装在想要监控的虚拟机上,已运行mysql,agentd
image
image

server的web上应该怎么设置?
image

[需求]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)

第三方多平台接入prometheus-exporter报路径错误

我分别在阿里云和UCLOUD的实例都部署了promethus-exporter和 redis_exporter ,当这俩机器的服务(promethus-exporter和 redis_exporter) 同时工作时,就会互相报找不到执行路径,如果采集器只留一个,则不会有这个问题。

监控系统的采集截图:
image

阿里云实例的报错日志:
image

ucloud实例的报错日志:
image

监控系统采集ucloud实例的采集配置:
image

监控系统采集aliyun实例的采集配置:
image

ucloud实例上的prometheus-exporter命令的执行路径
image

aliyun实例上的prometheus-exporter命令的执行路径
image

项目维护状态咨询

这个项目现在是不维护了吗
我想使用这个程序采集prometheus指标推给open-falcon,是否可行呢

使用 -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.多插件机制,即每个插件只监控一个节点。

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?

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.