Skip to content

Comments

Reduce payload size sent by agent in remote config#8238

Open
andrewlock wants to merge 2 commits intoandrew/remote-config/remove-regexfrom
andrew/remote-config/root-version
Open

Reduce payload size sent by agent in remote config#8238
andrewlock wants to merge 2 commits intoandrew/remote-config/remove-regexfrom
andrew/remote-config/root-version

Conversation

@andrewlock
Copy link
Member

Summary of changes

Stop sending the fixed RootVersion = 1 with every remote config request

Reason for change

Currently we're sending a fixed value of RootVersion = 1 for all our remote config requests, but doing so causes the agent to repeatedly send us all the root certificates, significantly increasing the payload size, because it thinks we haven't seen them. Sending the "final" version, acknowledges it, and stops all the extra data, saving ~35kB per call.

Implementation details

  • Deserialize the roots in GetRcmResponse, leaving them as base64 encoded strings (which is how they are sent in the payload)
  • When processing the response, de-encode the last root object, and deserialize it

This implementation avoids ~35kB per call for subsequent remote config requests.

Test coverage

Added unit test, and did manual test with the real agent, to confirm the expected behaviour (reduction in data sent)

Other details

https://datadoghq.atlassian.net/browse/LANGPLAT-940

All part of the Remote Config perf stack

Previously, we were always sending the same rootversion, which meant that RCM was always sending us the signatures, which significantly increases the payload size sent to us (~35kB of data)

We still pay the cost of this the first time _and_ we now materialize the strings, but we avoid it for all subsequent requests
@andrewlock andrewlock requested a review from a team as a code owner February 23, 2026 17:51
@andrewlock andrewlock added type:performance Performance, speed, latency, resource usage (CPU, memory) area:remote-config labels Feb 23, 2026
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 33707ed9b0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

{
ArrayPool = JsonArrayPool.Shared,
};
var tufRoot = new JsonSerializer().Deserialize<MinimalTufRoot>(jsonReader);

Choose a reason for hiding this comment

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

P0 Badge Add missing namespace for MinimalTufRoot deserialization

MinimalTufRoot is declared in Datadog.Trace.RemoteConfigurationManagement.Protocol.Tuf, but this file only imports ...Protocol, so this generic call does not resolve and the tracer project fails to compile (CS0246 on dotnet build tracer/src/Datadog.Trace/Datadog.Trace.csproj). Because this blocks all target frameworks from building, the change cannot be shipped as-is.

Useful? React with 👍 / 👎.

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

Labels

area:remote-config type:performance Performance, speed, latency, resource usage (CPU, memory)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant