Skip to content

Conversation

@Eokye
Copy link
Contributor

@Eokye Eokye commented Nov 6, 2025

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?

  • Agent: vX.Y.Z
  • Cluster Agent: vX.Y.Z

Describe your test plan

  1. Set log level to debug inmanager.yaml
  2. See that metadata forwarder is succesfully started and successfully sending metadata in logs
    example:
    {"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

  • PR has at least one valid label: bug, enhancement, refactoring, documentation, tooling, and/or dependencies
  • PR has a milestone or the qa/skip-qa label

@codecov-commenter
Copy link

codecov-commenter commented Nov 6, 2025

Codecov Report

❌ Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 37.68%. Comparing base (ba27d3f) to head (c3a5c9a).

Files with missing lines Patch % Lines
pkg/controller/utils/metadata/operator_metadata.go 0.00% 5 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2295   +/-   ##
=======================================
  Coverage   37.68%   37.68%           
=======================================
  Files         258      258           
  Lines       21690    21690           
=======================================
  Hits         8174     8174           
  Misses      12883    12883           
  Partials      633      633           
Flag Coverage Δ
unittests 37.68% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
pkg/controller/utils/metadata/operator_metadata.go 12.17% <0.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ba27d3f...c3a5c9a. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Eokye Eokye added this to the v1.21.0 milestone Nov 6, 2025
@Eokye Eokye added the enhancement New feature or request label Nov 6, 2025
@Eokye Eokye marked this pull request as ready for review November 7, 2025 19:47
@Eokye Eokye requested a review from a team as a code owner November 7, 2025 19:47
@Eokye Eokye marked this pull request as draft November 10, 2025 15:06
@Eokye Eokye marked this pull request as ready for review November 10, 2025 18:45
@Eokye Eokye changed the title [AGENTONB-2672] Refresh credentials for every sendMetadata in metadata_forwarders [AGENTONB-2672] Refresh credentials for every sendMetadata Nov 10, 2025
@swang392 swang392 mentioned this pull request Nov 10, 2025
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants