Skip to content

Commit 6b63551

Browse files
Update basic auth
1 parent 8d5adfb commit 6b63551

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

articles/azure-monitor/containers/prometheus-metrics-scrape-configuration.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,7 @@ metric_relabel_configs:
462462
463463
464464
### Basic Authentication
465+
### [Scrape Configs using Config file](#tab/ConfigFileScrapeConfigBasicAuth)
465466
466467
If you are using `basic_auth` setting in your prometheus configuration, please follow the steps -
467468

@@ -483,6 +484,7 @@ type: Opaque
483484
data:
484485
password1: <base64-encoded-string>
485486
```
487+
The **ama-metrics-mtls-secret** secret is mounted on to the ama-metrics containers at path - **/etc/prometheus/certs/** and is made available to the process that is scraping prometheus metrics. The key( ex - password1) in the above example will be the file name and the value is base64 decoded and added to the contents of the file within the container and the prometheus scraper uses the contents of this file to get the value that is used as the password used to scrape the endpoint.
486488

487489
2. In the configmap for the custom scrape configuration use the following setting -
488490
```yaml
@@ -491,6 +493,12 @@ basic_auth:
491493
password_file: /etc/prometheus/certs/password1
492494
493495
```
496+
By providing the path to the password_file above, the prometheus scraper uses the contents of the file named password1 in the path /etc/prometheus/certs as the value of password for basic auth based scraping.
497+
498+
### [Scrape Configs using CRD(Pod/Service Monitor)](#tab/CRDScrapeConfigBasicAuth)
499+
Scraping targets using basic auth is currently not supported using pod/service monitors. Support for this will be added in the upcoming releases.
500+
501+
---
494502

495503
### TLS based scraping
496504

0 commit comments

Comments
 (0)