Hello.
I'm trying to capture a prometheus endpoint but the site needs basic authentication with username and password for the collection to be done at /metrics/prometheus.
I found some information at this link: https://github.com/GoogleCloudPlatform/prometheus-engine/blob/v0.4.3-gke.0/doc/api.md#scrapeendpoint
The information above was still not enough for a successful collection.
Below is the podmonitoring configuration I performed to test:
apiVersion: monitoring.googleapis.com/v1
kind: PodMonitoring
metadata:
name: demo-prometheus
labels:
app.kubernetes.io/name: demo-prometheus
spec:
selector:
matchLabels:
app: demo-prometheus
endpoints:
- port: metrics-demo
path: /actuator/prometheus/
params:
headers:
authorization:
type: 'Basic'
credentials: 'bqwWFdsanaXM1Om00ZzFfsaSAWzNSo='
interval: 5s
I believe there are two errors, one is the bad formatting of yaml and the other error is possibly the parameters passed are not correct, the file that explains how the collection should be mounted does not make it clear how to pass the parameters.
By postman passing the authorization the data is returned correctly.

I appreciate the help.
Best answer by Julio_Costa
View original