Skip to content

Add Azure Monitor Workspace metrics provider - #1954

Open
chriscur wants to merge 1 commit into
fluxcd:mainfrom
chriscur:chriscur/azure-monitor-workspace-provider
Open

Add Azure Monitor Workspace metrics provider#1954
chriscur wants to merge 1 commit into
fluxcd:mainfrom
chriscur:chriscur/azure-monitor-workspace-provider

Conversation

@chriscur

Copy link
Copy Markdown

Add an azuremonitor metric template provider that queries the managed Prometheus endpoint of an Azure Monitor Workspace, removing the need to front the workspace with an aad-auth-proxy sidecar.

The provider embeds the Prometheus provider and only takes care of authentication. It resolves a Microsoft Entra ID token before each query and hands it to the Prometheus provider as a bearer token, so query handling, headers and error reporting stay unchanged.

The identity is taken from the values present in the referenced secret. A clientId and tenantId pair selects a workload identity, adding a clientSecret selects a service principal, and an absent secret falls back to the workload identity of the Flagger pod. The Azure cloud and the token audience are derived from the workspace host name, so no new provider fields or controller flags are needed.

The address is required to be an HTTPS Azure Monitor Workspace query endpoint and insecureSkipVerify is rejected, so that the token is only ever sent to a verified workspace host.

Add an `azuremonitor` metric template provider that queries the managed
Prometheus endpoint of an Azure Monitor Workspace, removing the need to
front the workspace with an aad-auth-proxy sidecar.

The provider embeds the Prometheus provider and only takes care of
authentication. It resolves a Microsoft Entra ID token before each query
and hands it to the Prometheus provider as a bearer token, so query
handling, headers and error reporting stay unchanged.

The identity is taken from the keys present in the referenced secret. A
clientId and tenantId pair selects a workload identity, adding a
clientSecret selects a service principal, and an absent secret falls back
to the workload identity of the Flagger pod. The Azure cloud and the
token audience are derived from the workspace host name, so no new
provider fields or controller flags are needed.

The address is required to be an HTTPS Azure Monitor Workspace query
endpoint and insecureSkipVerify is rejected, so that the token is only
ever sent to a verified workspace host.

Signed-off-by: Chris Curwick <chriscur@microsoft.com>
@chriscur

chriscur commented Jul 29, 2026

Copy link
Copy Markdown
Author

This change is ready for review. I'm currently running it on my dev/test clusters to get some real-world usage out of it.
The testing in my dev/test environment against real services in the pipeline to production came back good.

@devigned devigned left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From an Azure Golang SDK and auth perspective, token construction and usage lgtm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants