gesellix / couchdb-prometheus-exporter

CouchDB stats exporter for Prometheus

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Exporter throwing 401 error in Openshift

anushreemjoshi opened this issue · comments

I am using Openshift 4.3 and have deployed the exporter in a namespace. I have provided the credentials of the CouchDB instance as environment variable in the deployment
After the deployment, the pod for the exporter has started, however it is not able to connect to the Couch DB instance and throws this error:
collector.go:392] Error collecting stats: error collecting couchdb stats: status 401 Unauthorized (401): {"error":"unauthorized","reason":"Authentication required."}

The configuration in deployment yaml file is as follows:

spec:
containers:
- name: couchdb-prometheus-exporter
image: gesellix/couchdb-prometheus-exporter
ports:
- containerPort: 9984
protocol: TCP
env:
- name: COUCHDB_URI
value:
- name: COUCHDB_USERNAME
value:
- name: COUCHDB_PASSWORD
value:

Please let me know how to fix this issue.
Thanks.

@gesellix :
Please let me know your inputs for the mentioned issue.
Thanks.

Can you ensure that the environment variables are configured with non-empty values? Your snippet shows value: properties, but I don't know where OpenShift (or any other part of your setup) sets the actual values.

You might want to check the couchdb-prometheus-exporter environment when it's running. A command like this should show you the relevant properties, please use the correct container name, if it's not couchdb-prometheus-exporter:

docker inspect couchdb-prometheus-exporter | grep COUCHDB_

I'm going to close this issue because of missing feedback. Feel free to re-open if you can provide more details (e.g. checking the container's environment for the presence of credentials).