Skip to content
Merged
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

This file was deleted.

3 changes: 3 additions & 0 deletions collector/internal/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"go.opentelemetry.io/ebpf-profiler/internal/controller"
"go.opentelemetry.io/ebpf-profiler/reporter"
"go.opentelemetry.io/ebpf-profiler/times"
"go.opentelemetry.io/ebpf-profiler/vc"
)

// Controller is a bridge between the Collector's [receiverprofiles.Profiles]
Expand All @@ -26,6 +27,8 @@ func NewController(cfg *controller.Config,
cfg.MonitorInterval, cfg.ProbabilisticInterval)

rep, err := reporter.NewCollector(&reporter.Config{
Name: "otelcol-ebpf-profiler",
Version: vc.Version(),
MaxRPCMsgSize: 32 << 20, // 32 MiB
MaxGRPCRetries: 5,
GRPCOperationTimeout: intervals.GRPCOperationTimeout(),
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ require (
github.com/elastic/go-freelru v0.16.0
github.com/elastic/go-perf v0.0.0-20241029065020-30bec95324b8
github.com/google/uuid v1.6.0
github.com/jsimonetti/rtnetlink/v2 v2.0.3
github.com/klauspost/compress v1.18.0
github.com/mdlayher/kobject v0.0.0-20200520190114-19ca17470d7d
github.com/minio/sha256-simd v1.0.1
Expand Down Expand Up @@ -60,6 +59,7 @@ require (
github.com/google/go-cmp v0.7.0 // indirect
github.com/hashicorp/go-version v1.7.0 // indirect
github.com/josharian/native v1.1.0 // indirect
github.com/jsimonetti/rtnetlink/v2 v2.0.3 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/cpuid/v2 v2.2.8 // indirect
github.com/mdlayher/netlink v1.7.2 // indirect
Expand Down
122 changes: 4 additions & 118 deletions go.sum

Large diffs are not rendered by default.

138 changes: 0 additions & 138 deletions internal/helpers/address.go

This file was deleted.

16 changes: 0 additions & 16 deletions internal/helpers/kernel.go

This file was deleted.

120 changes: 0 additions & 120 deletions internal/helpers/namespaces.go

This file was deleted.

19 changes: 2 additions & 17 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
"golang.org/x/sys/unix"

"go.opentelemetry.io/ebpf-profiler/internal/controller"
"go.opentelemetry.io/ebpf-profiler/internal/helpers"
"go.opentelemetry.io/ebpf-profiler/reporter"
"go.opentelemetry.io/ebpf-profiler/times"
"go.opentelemetry.io/ebpf-profiler/vc"
Expand Down Expand Up @@ -102,20 +101,9 @@ func mainWithExitCode() exitCode {
intervals := times.New(cfg.ReporterInterval,
cfg.MonitorInterval, cfg.ProbabilisticInterval)

kernelVersion, err := helpers.GetKernelVersion()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What is the plan for these (and hostID) ?

Copy link
Copy Markdown
Member Author

@florianl florianl Jun 17, 2025

Choose a reason for hiding this comment

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

Like for the additional k8s attributes, the recommended way is to use OTel processors to enrich the data. Here is an example to enrich ResourceProfile with information like host.id:

processors:
  resourcedetection:
    detectors: [ system ]
    system:
      hostname_sources: [ "os" ]
      resource_attributes:
        host.id:
          enabled: true
        host.name:
          enabled: true

I'm well aware of discussions like open-telemetry/semantic-conventions#581. Dropping here the costum host.id and using OTel processors to gather it, aligns with OTel and simplifies correlation.

if err != nil {
log.Error(err)
return exitFailure
}

// hostname and sourceIP will be populated from the root namespace.
hostname, sourceIP, err := helpers.GetHostnameAndSourceIP(cfg.CollAgentAddr)
if err != nil {
log.Error(err)
return exitFailure
}

rep, err := reporter.NewOTLP(&reporter.Config{
Name: os.Args[0],
Version: vc.Version(),
CollAgentAddr: cfg.CollAgentAddr,
DisableTLS: cfg.DisableTLS,
MaxRPCMsgSize: 32 << 20, // 32 MiB
Expand All @@ -129,9 +117,6 @@ func mainWithExitCode() exitCode {
FramesCacheElements: 131072,
CGroupCacheElements: 1024,
SamplesPerSecond: cfg.SamplesPerSecond,
KernelVersion: kernelVersion,
HostName: hostname,
IPAddress: sourceIP,
})
if err != nil {
log.Error(err)
Expand Down
Loading