Comments (3)
Got the same problem here, with collectd 5.5.0 and collectd_exporter 0.2.0.
Tracked down to expfmt.MetricFamilyToText()
, but I have no idea why a counter could be recognized as a gauge.
from collectd_exporter.
There're actually two errors alternating:
expected counter in metric collectd_nginx_connections
expected gauge in metric collectd_nginx_connections
A possible cause is: multiple different metrics (with Dstype gauge and derive) share the same name, which confuses Prometheus's API.
Here's my debug code:
diff --git a/main.go b/main.go
index 4b0f14e..5fd960f 100644
--- a/main.go
+++ b/main.go
@@ -113,7 +113,14 @@ func newMetric(vl api.ValueList, index int) (prometheus.Metric, error) {
return nil, fmt.Errorf("unknown value type: %T", v)
}
- return prometheus.NewConstMetric(newDesc(vl, index), valueType, value)
+ name := newName(vl, index)
+ desc := newDesc(vl, index)
+
+ if name == "collectd_nginx_connections" {
+ log.Printf("%v\n", desc)
+ }
+
+ return prometheus.NewConstMetric(desc, valueType, value)
}
type collectdCollector struct {
And this is what I got:
$ ./collectd_exporter -log.level=debug
INFO[0000] Starting Server: :9103 file=main.go line=273
INFO[0010] Desc{fqName: "collectd_nginx_connections", help: "Collectd exporter: 'nginx' Type: 'nginx_connections' Dstype: 'api.Gauge' Dsname: 'value'", constLabels: {instance="zerus",nginx="waiting"}, variableLabels: []}
file=main.go line=120
INFO[0010] Desc{fqName: "collectd_nginx_connections", help: "Collectd exporter: 'nginx' Type: 'connections' Dstype: 'api.Derive' Dsname: 'value'", constLabels: {instance="zerus",nginx="handled"}, variableLabels: []}
file=main.go line=120
INFO[0010] Desc{fqName: "collectd_nginx_connections", help: "Collectd exporter: 'nginx' Type: 'nginx_connections' Dstype: 'api.Gauge' Dsname: 'value'", constLabels: {instance="zerus",nginx="writing"}, variableLabels: []}
file=main.go line=120
INFO[0010] Desc{fqName: "collectd_nginx_connections", help: "Collectd exporter: 'nginx' Type: 'nginx_connections' Dstype: 'api.Gauge' Dsname: 'value'", constLabels: {instance="zerus",nginx="active"}, variableLabels: []}
file=main.go line=120
INFO[0010] Desc{fqName: "collectd_nginx_connections", help: "Collectd exporter: 'nginx' Type: 'connections' Dstype: 'api.Derive' Dsname: 'value'", constLabels: {instance="zerus",nginx="accepted"}, variableLabels: []}
file=main.go line=120
INFO[0010] Desc{fqName: "collectd_nginx_connections", help: "Collectd exporter: 'nginx' Type: 'nginx_connections' Dstype: 'api.Gauge' Dsname: 'value'", constLabels: {instance="zerus",nginx="reading"}, variableLabels: []}
file=main.go line=120
from collectd_exporter.
FYI, this is how write_graphite
plugin of collectd concats the "labels":
collectd.zerus.nginx.connections.accepted.value
collectd.zerus.nginx.connections.handled.value
collectd.zerus.nginx.nginx_connections.active.value
collectd.zerus.nginx.nginx_connections.reading.value
collectd.zerus.nginx.nginx_connections.waiting.value
collectd.zerus.nginx.nginx_connections.writing.value
collectd.zerus.nginx.nginx_requests.value
from collectd_exporter.
Related Issues (20)
- Many errors when getting /metrics HOT 2
- Collected Exporter with heavy load HOT 5
- collectd_exporter - Prometheus target
- Not receiving any metrics from collectd HOT 1
- SPARC/Solaris compatibility HOT 1
- What's the role of this project vs collectd's write_prometheus plugin? HOT 2
- s390x support in CI HOT 3
- make fails with tcp timeout. HOT 1
- Metrics has different names that with write_prometheus
- errors in metrics output HOT 2
- metrics endpoint is broken with signalfx-metadata plugin
- Installation or Configuration documents
- error "*** was collected before with the same name and label values" HOT 4
- Prometheus collectd-exporter binary for s390x HOT 7
- Switch logging to go-kit
- Prefix to differentiate metrics from different clusters HOT 1
- Docker hub tags don't seem to be up to date HOT 4
- Arm builds HOT 2
- Feature request - Make Timeout configurable via a flag
- HTTPS endpoint HOT 5
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.
from collectd_exporter.