[AGENTONB-2672] Refresh credentials for every sendMetadata #2295
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
A brief description of the change being made with this pull request.
Currently, with the way metadata forwarder is written, secret refreshes will not work. Creds are gotten only once, instead of on every send of data like in metric forwarders. A small refactor is needed.
Motivation
What inspired you to submit this pull request?
Additional Notes
Anything else we should know when reviewing?
Minimum Agent Versions
Are there minimum versions of the Datadog Agent and/or Cluster Agent required?
Describe your test plan
manager.yamlexample:
{"level":"DEBUG","ts":"2025-11-10T18:36:37.933Z","logger":"metadata","msg":"Read operator metadata response","status code":202,"body":"Accepted"}By virtue of getting creds before every send, MetadataForwarders will use updated creds to send metadata to datadog. Creds are only updated in case of a secret change (the secret used in the datadog-agent manifest) or a refresh from a secret refresh for operator creds.
Write there any instructions and details you may have to test your PR.
Checklist
bug,enhancement,refactoring,documentation,tooling, and/ordependenciesqa/skip-qalabel