Skip to content

Commit

Permalink
Fix signature
Browse files Browse the repository at this point in the history
  • Loading branch information
gjulianm committed Jan 9, 2025
1 parent cb4a184 commit 774659d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion pkg/ebpf/telemetry/modifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (

manager "github.com/DataDog/ebpf-manager"

ddebpf "github.com/DataDog/datadog-agent/pkg/ebpf"
"github.com/DataDog/datadog-agent/pkg/ebpf/maps"
"github.com/DataDog/datadog-agent/pkg/ebpf/names"
"github.com/DataDog/datadog-agent/pkg/util/log"
Expand All @@ -28,6 +29,11 @@ const (
// ErrorsTelemetryModifier is a modifier that sets up the manager to handle eBPF telemetry.
type ErrorsTelemetryModifier struct{}

// Ensure it implements the required interfaces
var _ ddebpf.ModifierBeforeInit = &ErrorsTelemetryModifier{}
var _ ddebpf.ModifierAfterInit = &ErrorsTelemetryModifier{}
var _ ddebpf.ModifierBeforeStop = &ErrorsTelemetryModifier{}

// String returns the name of the modifier.
func (t *ErrorsTelemetryModifier) String() string {
return "ErrorsTelemetryModifier"
Expand Down Expand Up @@ -172,7 +178,7 @@ func (t *ErrorsTelemetryModifier) AfterInit(m *manager.Manager, module names.Mod
}

// BeforeStop stops the perf collector from telemetry and removes the modules from the telemetry maps.
func (t *ErrorsTelemetryModifier) BeforeStop(m *manager.Manager, module names.ModuleName) error {
func (t *ErrorsTelemetryModifier) BeforeStop(m *manager.Manager, module names.ModuleName, _ manager.MapCleanupType) error {
if errorsTelemetry == nil {
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/ebpf/telemetry/modifier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func TestModifierAppliesMultipleTimes(t *testing.T) {
require.NotEmpty(t, metrics, "No metrics collected on try %d", i)

// Run our BeforeStop
err = modifier.BeforeStop(mgr, mname)
err = modifier.BeforeStop(mgr, mname, manager.CleanAll)
require.NoError(t, err, "BeforeStop failed on try %d", i)

// Stop the manager
Expand Down

0 comments on commit 774659d

Please sign in to comment.