Skip to content

fix(config_migrate): logs were disabled#1792

Merged
gsanchezgavier merged 2 commits intomainfrom
fix/config-migrate-disabled-logs
Oct 24, 2025
Merged

fix(config_migrate): logs were disabled#1792
gsanchezgavier merged 2 commits intomainfrom
fix/config-migrate-disabled-logs

Conversation

@DavSanchez
Copy link
Contributor

@DavSanchez DavSanchez commented Oct 22, 2025

What this PR does / why we need it

We use a filtering mechanism in which we disabled all logs not coming from newrelic_agent_control crate, which excluded newrelic_config_migrate

the filters used make it tricky to configure logging properly for config_migrate. For example, debug log level cannot be activated, and previously the logs would be emitted depending on if the 'callsite' is inside the AC crate or not.

the error handling of config_migrate needs to be improved in any case.

Which issue this PR fixes

The logs seemed unpredictable, sometimes they are seen and sometimes they're not, depending if some error was found when migrating.

Checklist

[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]

  • Provided a meaningful title following conventional commit style.
  • Included a detailed description for the Pull Request.
  • Documentation under docs is aligned with the change.
  • Follows guidelines for Pull Requests in CONTRIBUTING.md.
  • Follows log level guidelines.

We use a filtering mechanism in which we disabled all logs not coming from `newrelic_agent_control` crate, which excluded `newrelic_config_migrate`

the filters used make it tricky to configure logging properly for config_migrate. For example, debug log level cannot be activated, and previously the logs would be emitted depending on if the 'callsite' is inside the AC crate or not.

the error handling of `config_migrate` needs to be improved in any case.
@DavSanchez DavSanchez requested a review from a team as a code owner October 22, 2025 09:55
@sigilioso
Copy link
Contributor

Let's also check the config for on-host and k8s cli, in case there are issues there as well.

@DavSanchez DavSanchez marked this pull request as draft October 22, 2025 10:29
name: "everything default",
config: Default::default(),
expected: "newrelic_agent_control=info,opamp_client=info,off",
expected: "newrelic_config_migrate=info,newrelic_agent_control=info,opamp_client=info,off",
Copy link
Member

Choose a reason for hiding this comment

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

the PR looks good but tests are still broken

thread 'instrumentation::config::logs::config::tests::test_valid_logging_filtering' panicked at agent-control\src\instrumentation\config\logs\config.rs:196:17:
assertion `left == right` failed: empty insecure fine grained does not apply
  left: "newrelic_config_migrate=info,newrelic_agent_control=info,opamp_client=info,off"
 right: "newrelic_agent_control=info,opamp_client=info,off"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Somehow missed a case, fixed! 1cc90bd

@DavSanchez DavSanchez force-pushed the fix/config-migrate-disabled-logs branch from a0b9c66 to 1cc90bd Compare October 23, 2025 08:38
@DavSanchez DavSanchez marked this pull request as ready for review October 23, 2025 08:39
@DavSanchez DavSanchez enabled auto-merge (squash) October 23, 2025 08:39
@DavSanchez DavSanchez requested review from a team and paologallinaharbur October 23, 2025 08:40
@DavSanchez DavSanchez disabled auto-merge October 23, 2025 13:17
@gsanchezgavier gsanchezgavier merged commit 6baff29 into main Oct 24, 2025
26 checks passed
@gsanchezgavier gsanchezgavier deleted the fix/config-migrate-disabled-logs branch October 24, 2025 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants