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

NGINX plus receiver #742

Open
wants to merge 28 commits into
base: v3
Choose a base branch
from
Open

NGINX plus receiver #742

wants to merge 28 commits into from

Conversation

dhurley
Copy link
Collaborator

@dhurley dhurley commented Jul 9, 2024

Proposed changes

  • Collect NGINX Plus metrics
  • Update collector configuration to be dynamic depending on want instances are found
  • Add build agent with nginx plus image make target
  • Add mock OTel collector package for testing purposes

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

@dhurley dhurley self-assigned this Jul 9, 2024
@github-actions github-actions bot added chore Pull requests for routine tasks dependencies documentation Improvements or additions to documentation labels Jul 9, 2024
.golangci.yml Outdated Show resolved Hide resolved
@dhurley dhurley marked this pull request as ready for review July 16, 2024 12:33
Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Makefile Show resolved Hide resolved
Makefile Show resolved Hide resolved
func (oc *Collector) handleNginxConfigUpdate(ctx context.Context, msg *bus.Message) {
nginxConfigContext, ok := msg.Data.(*model.NginxConfigContext)
if !ok {
slog.ErrorContext(ctx, "Unable to cast message payload to *model.NginxConfigContext", "payload", msg.Data)
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably need a return here too.

Suggested change
slog.ErrorContext(ctx, "Unable to cast message payload to *model.NginxConfigContext", "payload", msg.Data)
slog.ErrorContext(ctx, "Unable to cast message payload to *model.NginxConfigContext", "payload", msg.Data)
Suggested change
slog.ErrorContext(ctx, "Unable to cast message payload to *model.NginxConfigContext", "payload", msg.Data)
slog.ErrorContext(ctx, "Unable to cast message payload to *model.NginxConfigContext", "payload", msg.Data)
return

errChan := make(chan error)

oc.stopped = false
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a side note, should we toggle this to true when we receive an error from oc.service.Run(ctx) and/or when state is otelcol.StateClosed in the for loop below?

@@ -117,19 +119,182 @@ func (oc *Collector) Close(ctx context.Context) error {
slog.InfoContext(ctx, "Closing OTel Collector plugin")

if !oc.stopped {
slog.InfoContext(ctx, "Shutting down OTel Collector", "state", oc.service.GetState())
oc.stopped = true
Copy link
Contributor

Choose a reason for hiding this comment

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

Just in the interest of correctness, should we toggle this only when state is otelcol.StateClosed in our backoff function?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Pull requests for routine tasks dependencies documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants