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

Not able to get key value metrics exported #160

Open
mjnasir opened this issue Feb 19, 2020 · 10 comments
Open

Not able to get key value metrics exported #160

mjnasir opened this issue Feb 19, 2020 · 10 comments

Comments

@mjnasir
Copy link

mjnasir commented Feb 19, 2020

I am trying to load kv from consul with --kv.prefix=/. Its bringing nothing

@simonpasquier
Copy link
Member

Can you share the exporter's logs as well as command line flags?

@mjnasir
Copy link
Author

mjnasir commented Feb 20, 2020

Logs are
level=info ts=2020-02-19T12:59:41.596Z caller=consul_exporter.go:462 msg="Starting consul_exporter" version="(version=0.6.0, branch=HEAD, revision=79bc2cc7095de15a843a538a8edc3f1f254c2848)" level=info ts=2020-02-19T12:59:41.597Z caller=consul_exporter.go:463 build_context="(go=go1.13.5, user=root@4a16293ae5a8, date=20191216-15:37:09)" level=info ts=2020-02-19T12:59:41.597Z caller=consul_exporter.go:514 msg="Listening on address" address=:9107

and flag are --kv.prefix=/

@simonpasquier
Copy link
Member

I presume that you have no numeric value. From README.md:

Keys with non-numeric values are omitted

@mjnasir
Copy link
Author

mjnasir commented Feb 20, 2020

Nope. none
even not able to read numeric values

@simonpasquier
Copy link
Member

I've just checked and it works for me.

@mjnasir
Copy link
Author

mjnasir commented Feb 20, 2020

Colud you please share with me key and its value, and also please share flags
Thanks in advance

@simonpasquier
Copy link
Member

The flags are --kv.prefix=/, my key is foo and its value is 1.20.

@yujhe
Copy link

yujhe commented Aug 27, 2020

I have the same issue. I found that the value stored in Consul kv storage is encoded with base64 by default, but I did not find decode operation in https://github.com/prometheus/consul_exporter/blob/master/consul_exporter.go#L428
Is that the reason?

I add the key by HTTP API, e.g.

curl \
  --insecure \
  --header "X-Consul-Token: <token>" \
  --request PUT \
  "https://localhost:8501/v1/kv/xxx" \
  -d '123'

@yujhe
Copy link

yujhe commented Aug 28, 2020

I solved it by adding the right permission for the consul agent ACL token.

@pmmalinov01
Copy link

@yujhe Do you mind sharing what were the right permissions?

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

4 participants