Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump to latest version of upstream profiler #2997

Closed
wants to merge 1 commit into from
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
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ require (
github.com/common-nighthawk/go-figure v0.0.0-20210622060536-734e95fb86be
github.com/containerd/containerd v1.7.20
github.com/docker/docker v26.1.5+incompatible
github.com/elastic/go-freelru v0.13.0
github.com/elastic/go-freelru v0.15.0
github.com/gogo/protobuf v1.3.2
github.com/golang/snappy v0.0.4
github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1
Expand Down Expand Up @@ -149,4 +149,4 @@ require (
sigs.k8s.io/yaml v1.3.0 // indirect
)

replace go.opentelemetry.io/ebpf-profiler => github.com/parca-dev/opentelemetry-ebpf-profiler v0.0.0-20241030163650-5b64dd57b3ea
replace go.opentelemetry.io/ebpf-profiler => github.com/parca-dev/opentelemetry-ebpf-profiler v0.0.0-20241104193537-4a67756a8175
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c h1:+pKlWGMw7gf6bQ
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA=
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/elastic/go-freelru v0.13.0 h1:TKKY6yCfNNNky7Pj9xZAOEpBcdNgZJfihEftOb55omg=
github.com/elastic/go-freelru v0.13.0/go.mod h1:bSdWT4M0lW79K8QbX6XY2heQYSCqD7THoYf82pT/H3I=
github.com/elastic/go-freelru v0.15.0 h1:Jo1aY8JAvpyxbTDJEudrsBfjFDaALpfVv8mxuh9sfvI=
github.com/elastic/go-freelru v0.15.0/go.mod h1:bSdWT4M0lW79K8QbX6XY2heQYSCqD7THoYf82pT/H3I=
github.com/elastic/go-perf v0.0.0-20241016160959-1342461adb4a h1:ymmtaN4bVCmKKeu4XEf6JEWNZKRXPMng1zjpKd+8rCU=
github.com/elastic/go-perf v0.0.0-20241016160959-1342461adb4a/go.mod h1:Nt+pnRYvf0POC+7pXsrv8ubsEOSsaipJP0zlz1Ms1RM=
github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g=
Expand Down Expand Up @@ -244,8 +244,8 @@ github.com/opencontainers/runtime-spec v1.1.0 h1:HHUyrt9mwHUjtasSbXSMvs4cyFxh+Bl
github.com/opencontainers/runtime-spec v1.1.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
github.com/opencontainers/selinux v1.11.0 h1:+5Zbo97w3Lbmb3PeqQtpmTkMwsW5nRI3YaLpt7tQ7oU=
github.com/opencontainers/selinux v1.11.0/go.mod h1:E5dMC3VPuVvVHDYmi78qvhJp8+M586T4DlDRYpFkyec=
github.com/parca-dev/opentelemetry-ebpf-profiler v0.0.0-20241030163650-5b64dd57b3ea h1:HNLGar6f5Sy9DqZirDu4zIniX3Bg90GelQB9HKdhoRQ=
github.com/parca-dev/opentelemetry-ebpf-profiler v0.0.0-20241030163650-5b64dd57b3ea/go.mod h1:poOphaa9n1NeidFV425KI5PzP6Ho90LEkERlJqLBEpE=
github.com/parca-dev/opentelemetry-ebpf-profiler v0.0.0-20241104193537-4a67756a8175 h1:kbYjuzdrfATB2XDrZdh+X6ezpqMzROPv6SdbJkjK7jk=
github.com/parca-dev/opentelemetry-ebpf-profiler v0.0.0-20241104193537-4a67756a8175/go.mod h1:LZs0Ai6k5IPICeMqXRDpr1uyW7NJnoXgyrlaQh36XSM=
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 h1:onHthvaw9LFnH4t2DcNVpwGmV9E1BkGknEliJkfwQj0=
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58/go.mod h1:DXv8WO4yhMYhSNPKjeNKa5WY9YCIEBRbNzFFPJbWO6Y=
github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ=
Expand Down
10 changes: 1 addition & 9 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,6 @@ func mainWithExitCode() flags.ExitCode {
return flags.Failure(fmt.Sprintf("Failed to probe eBPF syscall: %v", err))
}

if err = tracer.ProbeTracepoint(); err != nil {
log.Warnf("Failed to probe tracepoint: %v. Parca-agent may fail to run on some kernel versions.", err)
}

externalLabels := reporter.Labels{}
if len(f.Metadata.ExternalLabels) > 0 {
for name, value := range f.Metadata.ExternalLabels {
Expand Down Expand Up @@ -340,11 +336,7 @@ func mainWithExitCode() flags.ExitCode {
log.Printf("eBPF tracer loaded")
defer trc.Close()

// Initial scan of /proc filesystem to list currently-active PIDs and have them processed.
if err = trc.StartPIDEventProcessor(mainCtx); err != nil {
log.Errorf("Failed to list processes from /proc: %v", err)
}
log.Debug("Completed initial PID listing")
trc.StartPIDEventProcessor(mainCtx)

// Attach our tracer to the perf event
if err := trc.AttachTracer(); err != nil {
Expand Down
42 changes: 0 additions & 42 deletions metrics/all.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion metrics/genschema/gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def read_json_array(filename):
package metrics

import (
\totelmetrics "github.com/open-telemetry/opentelemetry-ebpf-profiler/metrics"
\totelmetrics "go.opentelemetry.io/ebpf-profiler/metrics"
)

const (
Expand Down
7 changes: 7 additions & 0 deletions metrics/metrics.json
Original file line number Diff line number Diff line change
Expand Up @@ -434,48 +434,55 @@
"id": 59
},
{
"obsolete": true,
"description": "Indicator for whether the exeMetadata queue has been overwritten",
"type": "counter",
"name": "ExeMetadataOverwrite",
"field": "agent.overwrites.exe_metadata",
"id": 60
},
{
"obsolete": true,
"description": "Indicator for whether the countsForTraces queue has been overwritten",
"type": "counter",
"name": "CountsForTracesOverwrite",
"field": "agent.overwrites.counts_for_traces",
"id": 61
},
{
"obsolete": true,
"description": "Indicator for whether the metrics queue has been overwritten",
"type": "counter",
"name": "MetricsOverwrite",
"field": "agent.overwrites.metrics",
"id": 62
},
{
"obsolete": true,
"description": "Indicator for whether the framesForTraces queue has been overwritten",
"type": "counter",
"name": "FramesForTracesOverwrite",
"field": "agent.overwrites.frames_for_traces",
"id": 63
},
{
"obsolete": true,
"description": "Indicator for whether the frameMetadata queue has been overwritten",
"type": "counter",
"name": "FrameMetadataOverwrite",
"field": "agent.overwrites.frame_metadata",
"id": 64
},
{
"obsolete": true,
"description": "Indicator for whether the hostMetadata queue has been overwritten",
"type": "counter",
"name": "HostMetadataOverwrite",
"field": "agent.overwrites.host_metadata",
"id": 65
},
{
"obsolete": true,
"description": "Indicator for whether the fallbackSymbols queue has been overwritten",
"type": "counter",
"name": "FallbackSymbolsOverwrite",
Expand Down
17 changes: 17 additions & 0 deletions reporter/parca_reporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,13 @@ func (r *ParcaReporter) ReportFramesForTrace(_ *libpf.Trace) {}
func (r *ParcaReporter) ReportCountForTrace(_ libpf.TraceHash, _ uint16, _ *reporter.TraceEventMeta) {
}

// ExecutableKnown reports whether the FileID is known. The caller
// can use this to determine whether to call `ExecutableMetadata`.
func (r *ParcaReporter) ExecutableKnown(fileID libpf.FileID) bool {
_, ok := r.executables.Get(fileID)
return ok
}

// ExecutableMetadata accepts a fileID with the corresponding filename
// and caches this information.
func (r *ParcaReporter) ExecutableMetadata(args *reporter.ExecutableMetadataArgs) {
Expand Down Expand Up @@ -526,6 +533,16 @@ func New(
return r, nil
}

// Start is called by the controller to start the reporter.
//
// This should never be called in our case, since we don't currently
// use the controller from the otel package, but it's needed for
// us to implement the Reporter interface.
func (r *ParcaReporter) Start(ctx context.Context) error {
_, err := r.Run(ctx)
return err
}

func (r *ParcaReporter) Run(mainCtx context.Context) (reporter.Reporter, error) {
// Create a child context for reporting features
ctx, cancelReporting := context.WithCancel(mainCtx)
Expand Down