Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions internal/pkg/otel/manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,17 @@
}
// pass the error to the errCh so the coordinator, unless it's a cancel error
if !errors.Is(err, context.Canceled) {
<<<<<<< HEAD

Check failure on line 111 in internal/pkg/otel/manager/manager.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

syntax error: unexpected <<, expected }

Check failure on line 111 in internal/pkg/otel/manager/manager.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

syntax error: unexpected <<, expected }
m.reportErr(ctx, err)
=======

Check failure on line 113 in internal/pkg/otel/manager/manager.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

syntax error: unexpected ==, expected }
select {
case m.errCh <- err:
case <-ctx.Done():
}
>>>>>>> 371399ccb (Fix runtime error reporting in Otel manager (#6793))

Check failure on line 118 in internal/pkg/otel/manager/manager.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

syntax error: unexpected >>, expected case or default or }

Check failure on line 118 in internal/pkg/otel/manager/manager.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

invalid character U+0023 '#'
}

Check failure on line 119 in internal/pkg/otel/manager/manager.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

syntax error: unexpected }, expected :
}
case cfg := <-m.cfgCh:

Check failure on line 121 in internal/pkg/otel/manager/manager.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

syntax error: unexpected keyword case, expected }
m.cfg = cfg
if cfg == nil {
// no configuration then the collector should not be
Expand Down Expand Up @@ -157,7 +164,7 @@
}
}
}
}

Check failure on line 167 in internal/pkg/otel/manager/manager.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

syntax error: non-declaration statement outside function body) (typecheck)
}

// Errors returns channel that can send an error that affects the state of the running agent.
Expand Down
9 changes: 9 additions & 0 deletions internal/pkg/otel/manager/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,11 @@ func TestOTelManager_ConfigError(t *testing.T) {

go func() {
err := m.Run(ctx)
<<<<<<< HEAD
assert.ErrorIs(t, err, context.Canceled, "otel manager should be cancelled")
=======
require.ErrorIs(t, err, context.Canceled, "otel manager should be cancelled")
>>>>>>> 371399ccb (Fix runtime error reporting in Otel manager (#6793))
}()

// watch is synchronous, so we need to read from it to avoid blocking the manager
Expand All @@ -205,6 +209,7 @@ func TestOTelManager_ConfigError(t *testing.T) {
}
}()

<<<<<<< HEAD
// Errors channel is non-blocking, should be able to send an Update that causes an error multiple
// times without it blocking on sending over the errCh.
for range 3 {
Expand All @@ -221,6 +226,10 @@ func TestOTelManager_ConfigError(t *testing.T) {
//
// a nil error just means that the collector is trying to restart
// which clears the error on the restart loop
=======
cfg := confmap.New() // invalid config
m.Update(cfg)
>>>>>>> 371399ccb (Fix runtime error reporting in Otel manager (#6793))
timeoutCh := time.After(time.Second * 5)
var err error
outer:
Expand Down
Loading