Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code no longer builds due to deprecation of Counter.Set() #24

Closed
EdSchouten opened this issue Oct 31, 2016 · 2 comments
Closed

Code no longer builds due to deprecation of Counter.Set() #24

EdSchouten opened this issue Oct 31, 2016 · 2 comments

Comments

@EdSchouten
Copy link
Contributor

When building this code with the latest Prometheus client library, I get:

# github.com/ewr/elasticsearch_exporter
./elasticsearch_exporter.go:300: e.counterVecs["jvm_gc_collection_seconds_count"].WithLabelValues(allStats.ClusterName, stats.Host, collector).Set undefined (type prometheus.Counter has no field or method Set)
./elasticsearch_exporter.go:301: e.counterVecs["jvm_gc_collection_seconds_sum"].WithLabelValues(allStats.ClusterName, stats.Host, collector).Set undefined (type prometheus.Counter has no field or method Set)
./elasticsearch_exporter.go:312: e.counterVecs["thread_pool_completed_count"].WithLabelValues(allStats.ClusterName, stats.Host, pool).Set undefined (type prometheus.Counter has no field or method Set)
./elasticsearch_exporter.go:313: e.counterVecs["thread_pool_rejected_count"].WithLabelValues(allStats.ClusterName, stats.Host, pool).Set undefined (type prometheus.Counter has no field or method Set)
./elasticsearch_exporter.go:330: e.counters["indices_fielddata_evictions"].WithLabelValues(allStats.ClusterName, stats.Host).Set undefined (type prometheus.Counter has no field or method Set)
./elasticsearch_exporter.go:333: e.counters["indices_filter_cache_evictions"].WithLabelValues(allStats.ClusterName, stats.Host).Set undefined (type prometheus.Counter has no field or method Set)
./elasticsearch_exporter.go:336: e.counters["indices_query_cache_evictions"].WithLabelValues(allStats.ClusterName, stats.Host).Set undefined (type prometheus.Counter has no field or method Set)
./elasticsearch_exporter.go:339: e.counters["indices_request_cache_evictions"].WithLabelValues(allStats.ClusterName, stats.Host).Set undefined (type prometheus.Counter has no field or method Set)
./elasticsearch_exporter.go:348: e.counters["indices_store_throttle_time_ms_total"].WithLabelValues(allStats.ClusterName, stats.Host).Set undefined (type prometheus.Counter has no field or method Set)
./elasticsearch_exporter.go:350: e.counters["indices_flush_total"].WithLabelValues(allStats.ClusterName, stats.Host).Set undefined (type prometheus.Counter has no field or method Set)
./elasticsearch_exporter.go:350: too many errors

Turns out Counter.Set() has been removed. the code needs to be rewritten to no longer use Counter, but NewConstMetric() instead.

@dominikschulz
Copy link
Contributor

We should rewrite the code to avoid direct instrumentation anyway.

@bincentvaret
Copy link

bincentvaret commented May 17, 2017

Hello,

any hope to see this fixed ?

Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants