Skip to content

Commit

Permalink
Remove usage of UnregisterTelemetry
Browse files Browse the repository at this point in the history
  • Loading branch information
gjulianm committed Dec 26, 2024
1 parent 50ae141 commit 057c6ed
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 12 deletions.
7 changes: 0 additions & 7 deletions pkg/ebpf/telemetry/perf_metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,6 @@ func (p *perfUsageCollector) registerRingBuffer(rb *manager.RingBuffer) {
p.ringBuffers = append(p.ringBuffers, rb)
}

// UnregisterTelemetry unregisters the PerfMap and RingBuffers from telemetry
func UnregisterTelemetry(m *manager.Manager) {
if perfCollector != nil {
perfCollector.unregisterTelemetry(m)
}
}

func (p *perfUsageCollector) unregisterTelemetry(m *manager.Manager) {
p.mtx.Lock()
defer p.mtx.Unlock()
Expand Down
2 changes: 0 additions & 2 deletions pkg/network/tracer/connection/ebpf_tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
telemetryComponent "github.com/DataDog/datadog-agent/comp/core/telemetry"
ddebpf "github.com/DataDog/datadog-agent/pkg/ebpf"
"github.com/DataDog/datadog-agent/pkg/ebpf/maps"
ebpftelemetry "github.com/DataDog/datadog-agent/pkg/ebpf/telemetry"
"github.com/DataDog/datadog-agent/pkg/network"
"github.com/DataDog/datadog-agent/pkg/network/config"
netebpf "github.com/DataDog/datadog-agent/pkg/network/ebpf"
Expand Down Expand Up @@ -341,7 +340,6 @@ func (t *ebpfTracer) Stop() {
t.stopOnce.Do(func() {
close(t.exitTelemetry)
ddebpf.RemoveNameMappings(t.m)
ebpftelemetry.UnregisterTelemetry(t.m)
_ = t.m.Stop(manager.CleanAll)
t.closeConsumer.Stop()
t.ongoingConnectCleaner.Stop()
Expand Down
1 change: 0 additions & 1 deletion pkg/network/usm/ebpf_main.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,6 @@ func (e *ebpfProgram) Start() error {

// Close stops the ebpf program and cleans up all resources.
func (e *ebpfProgram) Close() error {
ebpftelemetry.UnregisterTelemetry(e.Manager.Manager)
var err error
// We need to stop the perf maps and ring buffers before stopping the protocols, as we need to stop sending events
// to them. If we don't do this, we might send events on closed channels which will panic.
Expand Down
2 changes: 0 additions & 2 deletions pkg/security/probe/probe_ebpf.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import (

"github.com/DataDog/datadog-agent/pkg/config/env"
ddebpf "github.com/DataDog/datadog-agent/pkg/ebpf"
ebpftelemetry "github.com/DataDog/datadog-agent/pkg/ebpf/telemetry"
"github.com/DataDog/datadog-agent/pkg/security/config"
"github.com/DataDog/datadog-agent/pkg/security/ebpf"
"github.com/DataDog/datadog-agent/pkg/security/ebpf/kernel"
Expand Down Expand Up @@ -1670,7 +1669,6 @@ func (p *EBPFProbe) Close() error {
}

ddebpf.RemoveNameMappings(p.Manager)
ebpftelemetry.UnregisterTelemetry(p.Manager)
// Stopping the manager will stop the perf map reader and unload eBPF programs
if err := p.Manager.Stop(manager.CleanAll); err != nil {
return err
Expand Down

0 comments on commit 057c6ed

Please sign in to comment.