Skip to content

Commit 2b042f0

Browse files
committed
fix(observability): configure ServiceMonitor for ASO secure metrics authentication
- Update azureserviceoperator-controller-manager-metrics-monitor to use HTTPS scheme - Add bearerTokenFile authentication using ServiceAccount token - Configure TLS with insecureSkipVerify for self-signed certificates - Resolves 401 Unauthorized errors when Prometheus scrapes ASO metrics The Azure Service Operator exposes secure metrics by default on HTTPS port 8443 requiring proper authentication. This change aligns with ASO documentation at https://azure.github.io/azure-service-operator/guide/metrics/ which states "A ServiceAccount token is required to scrape metrics securely". Fixes: ASO metrics like go_memstats_sys_bytes not appearing in Prometheus Signed-off-by: Bryan Cox <[email protected]>
1 parent 5b0130c commit 2b042f0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

hack/observability/prometheus/resources/prometheus.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,10 @@ spec:
105105
endpoints:
106106
- path: /metrics
107107
port: metrics
108-
scheme: http
108+
scheme: https
109+
bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
110+
tlsConfig:
111+
insecureSkipVerify: true
109112
selector:
110113
matchLabels:
111114
control-plane: controller-manager

0 commit comments

Comments
 (0)