Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Agent can forward logs while reconnecting to collector, even when logs are disabled at account level #1088

Closed
JcolemanNR opened this issue May 17, 2022 · 2 comments · Fixed by #1097
Labels
bug Something isn't working

Comments

@JcolemanNR
Copy link
Contributor

JcolemanNR commented May 17, 2022

Description
A customer has reported that the agent appears to be gathering and forwards logs based on default configuration before the account level disable is observed.

Expected Behavior
When log forwarding is disabled at an account level, the agent will not forward ANY logs to New Relic.

Steps to Reproduce
These are hypothetical, but I believe this is how to reproduce:

  • Disable log forwarding at the account level in the NR1 UI.
  • Start an application that has logging enabled (by default).
  • Manually trigger the agent to reconnect to the collector via NR1 Admin UI.
  • While the agent is reconnecting, some logs may be sent to NR1
@JcolemanNR JcolemanNR added the bug Something isn't working label May 17, 2022
@JcolemanNR
Copy link
Contributor Author

The .NET Agent team attempted to reproduce, but was unable. Periodic log event harvest/upload is not scheduled until after the account level server side configuration is observed by the agent.

In multiple testing scenarios, no logs were sent.

@JcolemanNR JcolemanNR changed the title Agent can potentially gather logs before account level disable is observed Agent can forward logs while reconnecting to collector, even when logs are disabled at account level May 17, 2022
@JcolemanNR
Copy link
Contributor Author

After investigating more, this is a real issue. The behavior can be observed intermittently when the .NET Agent is reconnecting to the collector.

The following lines are where the server provided configuration is cleared out during reconnection. The Scheduled harvest tasks are not fully disabled while this takes place:

private void Disable()
{
_dataRequestWire = new NoOpCollectorWire();
if (string.IsNullOrEmpty(_configuration.AgentRunId?.ToString()))
return;
EventBus<ServerConfigurationUpdatedEvent>.Publish(new ServerConfigurationUpdatedEvent(ServerConfiguration.GetDefault()));
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant