Skip to content

Fix Add OTel Receiver After Config Apply & Fix Reload Monitoring Old Log #1057

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

Merged
merged 43 commits into from
Apr 29, 2025

Conversation

aphralG
Copy link
Contributor

@aphralG aphralG commented Apr 24, 2025

Proposed changes

Changes to Config Apply:

  • Moved nginx_config_parser.go from internal/watcher/instance to /internal/datasource/config to allow the resource plugin to also have an NginxConfigParser to parse the config
  • Moved NginxPlusRuntimeInfoEqual, NginxRuntimeInfoEqual & UpdateNginxInstanceRuntime to /datasource/proto/instance.go from instance_watcher_service.go so they can be used in the ResourceService as well as the InstanceWatcherService
  • ConfigApplySuccessfulTopic now sends ConfigApplySuccess which contains a NginxConfigContext as well as a DataPlaneResponse instead of just a DataPlaneResponse
        type ConfigApplySuccess struct {
         ConfigContext     *NginxConfigContext
         DataPlaneResponse *v1.DataPlaneResponse
    
  • During a ConfigApply the resource service before Validating and Reloading the config will now parse the NGINX config so it can have access to any error logs that might have been added to monitor. If the validate and reload are successful it sends the NginxConfigContext created during the parse along with DataPlane Response
  • Added enabled to InstanceWatcher, the instance watcher is now stopped during a config apply to stop the NginxConfigContext not being sent.
  • Add new plus config to integration tests as there was problems being caused by changing the plus API to a Stub Status

Other changes made:

  • Moved logger creation from app.go to when we are resolving the agent config so allowedDir, enabled features etc are logged to agent log file
  • Added logs about shutting down and starting the stub status scraper
  • Removed enabled function from CredentialWatcher

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING document
  • I have run make install-tools and have attached any dependency changes to this pull request
  • If applicable, I have added tests that prove my fix is effective or that my feature works
  • If applicable, I have checked that any relevant tests pass after adding my changes
  • If applicable, I have updated any relevant documentation (README.md)
  • If applicable, I have tested my cross-platform changes on Ubuntu 22, Redhat 8, SUSE 15 and FreeBSD 13

@aphralG aphralG self-assigned this Apr 24, 2025
@aphralG aphralG requested a review from a team as a code owner April 24, 2025 11:21
@github-actions github-actions bot added bug Something isn't working chore Pull requests for routine tasks labels Apr 24, 2025
@oCHRISo oCHRISo added the v3.x Issues and Pull Requests related to the major version v3 label Apr 25, 2025
@aphralG aphralG merged commit 9dcd9a9 into v3 Apr 29, 2025
20 checks passed
@aphralG aphralG deleted the dynamically-add-otel-receiver-after-config-apply branch April 29, 2025 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working chore Pull requests for routine tasks v3.x Issues and Pull Requests related to the major version v3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants