Skip to content

Receive agent commands via metric_data response instead of polling - #3087

Draft
nr-csantos wants to merge 1 commit into
newrelic:mainfrom
nr-csantos:csantos/stop-polling-commands
Draft

Receive agent commands via metric_data response instead of polling#3087
nr-csantos wants to merge 1 commit into
newrelic:mainfrom
nr-csantos:csantos/stop-polling-commands

Conversation

@nr-csantos

@nr-csantos nr-csantos commented Aug 31, 2026

Copy link
Copy Markdown

Before contributing, please read our contributing guidelines and code of conduct.

Overview

Stops making a dedicated get_agent_commands collector RPC every harvest cycle. The collector now returns any pending agent commands as the return_value of metric_data (same [[id, {name, arguments}], ...] shape), so this eliminates one HTTP round-trip per harvest for the common case where there's nothing to do.

RPMService caches the commands returned by metric_data, and CommandParser now processes them from afterHarvest() instead of beforeHarvest(), so commands from a harvest's metric_data response are handled in that same cycle with no added latency.

Related Github Issue

Include a link to the related GitHub issue, if applicable

Testing

The agent includes a suite of tests which should be used to
verify your changes don't break existing functionality. These tests will run with
Github Actions when a pull request is made. More details on running the tests locally can be found
here,

Checks

  • Your contributions are backwards compatible with relevant frameworks and APIs.
  • Your code does not contain any breaking changes. Otherwise please describe.
  • Your code does not introduce any new dependencies. Otherwise please describe.

Stops making a dedicated get_agent_commands collector RPC every harvest
cycle. The collector now returns any pending agent commands as the
return_value of metric_data (same [[id, {name, arguments}], ...] shape),
so this eliminates one HTTP round-trip per harvest for the common case
where there's nothing to do.

RPMService caches the commands returned by metric_data, and CommandParser
now processes them from afterHarvest() instead of beforeHarvest(), so
commands from a harvest's metric_data response are handled in that same
cycle with no added latency.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@CLAassistant

CLAassistant commented Aug 31, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants