Skip to content
Draft
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
2 changes: 1 addition & 1 deletion cmd/process-agent/flags/flags_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ const (
// DefaultConfPath points to the location of datadog.yaml
DefaultConfPath = "/opt/datadog-agent/etc/datadog.yaml"
// DefaultSysProbeConfPath is set to empty since system-probe is not yet supported on darwin
DefaultSysProbeConfPath = ""
DefaultSysProbeConfPath = "/opt/datadog-agent/etc/system-probe.yaml"
)
2 changes: 1 addition & 1 deletion cmd/system-probe/modules/network_tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-present Datadog, Inc.

//go:build (linux && linux_bpf) || (windows && npm)
//go:build (linux && linux_bpf) || (windows && npm) || darwin

package modules

Expand Down
29 changes: 29 additions & 0 deletions cmd/system-probe/modules/network_tracer_darwin.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2024-present Datadog, Inc.

//go:build darwin

package modules

import (
"github.com/DataDog/datadog-agent/pkg/system-probe/api/module"
"github.com/DataDog/datadog-agent/pkg/system-probe/config"
)

func init() { registerModule(NetworkTracer) }

// NetworkTracer is a factory for NPM's tracer on Darwin
var NetworkTracer = &module.Factory{
Name: config.NetworkTracerModule,
ConfigNamespaces: networkTracerModuleConfigNamespaces,
Fn: createNetworkTracerModule,
}

// platformRegister is a stub for Darwin
// Platform-specific endpoints (like network_id on Linux) are not implemented yet
func (nt *networkTracer) platformRegister(httpMux *module.Router) error {
// No platform-specific endpoints for Darwin yet
return nil
}
19 changes: 19 additions & 0 deletions cmd/system-probe/modules/usm_endpoints_darwin.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2024-present Datadog, Inc.

//go:build darwin

package modules

import (
"github.com/DataDog/datadog-agent/pkg/system-probe/api/module"
)

// registerUSMEndpoints is a stub for Darwin
// Universal Service Monitoring (USM) is not yet implemented on macOS
func registerUSMEndpoints(nt *networkTracer, httpMux *module.Router) {
// USM features (HTTP, HTTP/2, Kafka monitoring) not implemented on Darwin yet
// This is a no-op stub to allow compilation
}
2 changes: 1 addition & 1 deletion pkg/ebpf/time.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-present Datadog, Inc.

//go:build linux
//go:build linux || darwin

package ebpf

Expand Down
19 changes: 19 additions & 0 deletions pkg/network/dns/monitor_darwin.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2024-present Datadog, Inc.

//go:build darwin

package dns

import (
"github.com/DataDog/datadog-agent/comp/core/telemetry"
"github.com/DataDog/datadog-agent/pkg/network/config"
)

// NewReverseDNS returns a stub ReverseDNS for Darwin
// DNS monitoring is not yet implemented on macOS
func NewReverseDNS(_ *config.Config, _ telemetry.Component) (ReverseDNS, error) {
return NewNullReverseDNS(), nil
}
2 changes: 1 addition & 1 deletion pkg/network/dns/null.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-present Datadog, Inc.

//go:build windows || linux_bpf
//go:build windows || linux_bpf || darwin

package dns

Expand Down
18 changes: 18 additions & 0 deletions pkg/network/filter/packet_constants_darwin.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2024-present Datadog, Inc.

//go:build darwin

package filter

// Define packet type constants for Darwin (these exist in unix package on Linux)
// We define them here to match the Linux values for compatibility
const (
PACKET_HOST = 0 // To us
PACKET_BROADCAST = 1 // To all
PACKET_MULTICAST = 2 // To group
PACKET_OTHERHOST = 3 // To someone else
PACKET_OUTGOING = 4 // Outgoing of any type
)
19 changes: 19 additions & 0 deletions pkg/network/filter/packet_constants_linux.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2024-present Datadog, Inc.

//go:build linux

package filter

import "golang.org/x/sys/unix"

// On Linux, alias the constants from the unix package for consistency with Darwin
const (
PACKET_HOST = unix.PACKET_HOST
PACKET_BROADCAST = unix.PACKET_BROADCAST
PACKET_MULTICAST = unix.PACKET_MULTICAST
PACKET_OTHERHOST = unix.PACKET_OTHERHOST
PACKET_OUTGOING = unix.PACKET_OUTGOING
)
Loading
Loading