Skip to content

prometheus: support tokenFilePath in AzureAD workload identity - #8647

Closed
andreipantelimonuip wants to merge 1 commit into
prometheus-operator:mainfrom
andreipantelimonuip:azuread-wi-token-file-path
Closed

andreipantelimonuip wants to merge 1 commit into
prometheus-operator:mainfrom
andreipantelimonuip:azuread-wi-token-file-path

Conversation

@andreipantelimonuip

Copy link
Copy Markdown

Description

Only clientId and tenantId were exposed on spec.remoteWrite[].azureAd.workloadIdentity. Prometheus 3.7.0 added a token_file_path option to the azuread workload_identity config, so this adds the optional tokenFilePath field to let the projected service-account token be read from a non-default mount path. When unset, Prometheus keeps using its built-in default (/var/run/secrets/azure/tokens/azure-identity-token).

This is needed because azure-workload-identity v1.6.0 changed the projected token mount path, a breaking change for users on that version. Without exposing tokenFilePath there is no way to point Prometheus at the new location through the operator.

Generated artifacts (CRDs, jsonnet, bundle.yaml, API docs, applyconfiguration, deepcopy) were regenerated via make.

Type of change

  • CHANGE (fix or feature that would cause existing functionality to not work as expected)
  • FEATURE (non-breaking change which adds functionality)
  • BUGFIX (non-breaking change which fixes an issue)
  • ENHANCEMENT (non-breaking change which improves existing functionality)
  • NONE (if none of the other choices apply. Example, tooling, build system, CI, docs, etc.)

Verification

go test ./pkg/prometheus/ passes, including a new golden test (RemoteWriteConfigAzureADWorkloadIdentityTokenFilePath_v3.7.0) asserting token_file_path is rendered into the remote-write config. go build ./... and go vet ./pkg/prometheus/ pass.

Changelog entry

Add `tokenFilePath` field to the AzureAD workload identity remote write configuration.

AI assistance (Claude) was used for this change and it has been reviewed.

The azuread workload_identity remote-write config gained a token_file_path
option in Prometheus 3.7.0. Expose it as the optional tokenFilePath field on
AzureAD's workloadIdentity so users can point Prometheus at a projected
service account token mounted at a non-default path. When unset, Prometheus
falls back to its built-in default path.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Signed-off-by: Andrei Pantelimon <[email protected]>
@andreipantelimonuip
andreipantelimonuip requested a review from a team as a code owner June 24, 2026 09:16

@heliapb heliapb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hi @andreipantelimonuip thanks for the pr but as defined here #7998 (comment) we haven't added filepath by design

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants