Hello,
Not able to set-up prometheus module with bearer token, getting 401 unauthorised
Below is the config:
metricbeat.modules:
- module: prometheus
period: 10s
hosts: ["http://dasda.xde.com:42115"]
metrics_path: /adaw/actuator/prometheus?tId=df-1a38be998f51
bearer_token_file: /opt/metricbeat-8.17.2-linux-x86_64/token.txt
Getting Below error:
{"log.level":"error","@timestamp":"2025-02-13T03:38:11.183+0530","log.origin":{"function":"github.com/elastic/beats/v7/metricbeat/mb/module.(*metricSetWrapper).handleFetchError","file.name":"module/wrapper.go","file.line":333},"message":"Error fetching data for metricset prometheus.collector: unable to decode response from prometheus endpoint: unexpected status code 401 from server","service.name":"metricbeat","ecs.version":"1.6.0"}
Pls let me know the issue here??