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

Add PID as an attribute in each sample #212

Merged
merged 10 commits into from
Nov 6, 2024

Conversation

bhavnajindal
Copy link
Contributor

@bhavnajindal bhavnajindal commented Oct 28, 2024

What:
This PR aims to add process Id as an attribute for each sample. This would be an addition to other attributes such as containerId, threadName etc. being sent currently.

Why:
Tools/services consuming the profiles sent by opentelemetry-ebpf-profiler could utilize the PID as an identifier for a process in their software/implementations.

@bhavnajindal bhavnajindal requested review from a team as code owners October 28, 2024 19:17
Copy link

linux-foundation-easycla bot commented Oct 28, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@christos68k
Copy link
Member

Hi @bhavnajindal, can you please also sign the CLA?

@bhavnajindal
Copy link
Contributor Author

Hi @bhavnajindal, can you please also sign the CLA?

Hi, I have initiated the process of signing the corporate CLA through my organization - IBM. Awaiting approval from the CLA manager.

@dmathieu
Copy link
Member

Note that we're about to introduce a new collector reporter, that will ultimately replace this OTLP one.

@bhavnajindal
Copy link
Contributor Author

@dmathieu Is there a feature branch available for the new collector reporter.

@dmathieu
Copy link
Member

#208

reporter/otlp_reporter.go Outdated Show resolved Hide resolved
@bhavnajindal bhavnajindal requested a review from florianl November 4, 2024 15:40
reporter/otlp_reporter.go Outdated Show resolved Hide resolved
@bhavnajindal bhavnajindal requested a review from florianl November 4, 2024 18:33
@rockdaboot
Copy link
Contributor

rockdaboot commented Nov 5, 2024

@bhavnajindal Just in case you prefer generics, there is a solution (feel free to use). It still requires a type switch, but you don't need to return error from addProfileAttributes().

generics.txt

@bhavnajindal
Copy link
Contributor Author

@rockdaboot Thank you for your solution. I had almost reached the same solution yesterday but my in-experience with go kept me from fully realizing the solution. I learnt a good deal from your code. Thanks again.

@bhavnajindal bhavnajindal requested a review from florianl November 5, 2024 15:24
reporter/otlp_reporter.go Show resolved Hide resolved
reporter/otlp_reporter.go Outdated Show resolved Hide resolved
reporter/otlp_reporter.go Outdated Show resolved Hide resolved
Copy link
Contributor

@rockdaboot rockdaboot left a comment

Choose a reason for hiding this comment

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

Thanks 👍

@christos68k christos68k merged commit 8ea42ea into open-telemetry:main Nov 6, 2024
23 checks passed
@florianl florianl mentioned this pull request Nov 7, 2024
florianl added a commit that referenced this pull request Nov 8, 2024
PR #212 changed the behaviour of addProfileAttributes(). Before adding an attribute the length of the string
was checked - see https://github.com/open-telemetry/opentelemetry-ebpf-profiler/blob/0c58efd41280bce80cca9804896c76874d383b35/reporter/otlp_reporter.go#L747-L749

This returns to the original behaivour, where string attributes with no
values are not added.

Signed-off-by: Florian Lehner <[email protected]>
bhavnajindal added a commit to instana/opentelemetry-ebpf-profiler that referenced this pull request Nov 14, 2024
ltrk2 added a commit to instana/opentelemetry-ebpf-profiler that referenced this pull request Dec 4, 2024
* Fix unwinding at syscall on aarch64 (open-telemetry#218)

* Add PID as an attribute in each sample (open-telemetry#212)

* ebpf: increase number of stack delta buckets (open-telemetry#231)

Signed-off-by: Florian Lehner <[email protected]>

* reporter: use htlhash attribute for profiling specific hash (open-telemetry#236)

Signed-off-by: Florian Lehner <[email protected]>

* reporter: drop fifo (open-telemetry#239)

Signed-off-by: Florian Lehner <[email protected]>

* Drop more unused code (open-telemetry#240)

* reporter: do not add empty attributes (open-telemetry#233)

Signed-off-by: Florian Lehner <[email protected]>

* controller: fix reporter interval mix up with monitor interval (open-telemetry#242)

* Extract reporter runloop (open-telemetry#228)

Co-authored-by: Christos Kalkanis <[email protected]>

* Extract lookupcgroupv2 out of the otlp reporter (open-telemetry#227)

* Add CPU id to trace and trace metadata (open-telemetry#249)

* reporter: don't expire actively used executables (open-telemetry#247)

* Remove legacy code from libpf.UnixTime64 (open-telemetry#252)

* Turn kernel module file parsing errors into warnings (open-telemetry#255)

Co-authored-by: Florian Lehner <[email protected]>

* readatbuf: add missing check when reading from tail chunk (open-telemetry#259)

* metrics: Don't send counters with 0 values (open-telemetry#246)

---------

Signed-off-by: Florian Lehner <[email protected]>
Co-authored-by: umanwizard <[email protected]>
Co-authored-by: Bhavna Jindal <[email protected]>
Co-authored-by: Florian Lehner <[email protected]>
Co-authored-by: Tim Rühsen <[email protected]>
Co-authored-by: Nayef Ghattas <[email protected]>
Co-authored-by: Damien Mathieu <[email protected]>
Co-authored-by: Christos Kalkanis <[email protected]>
Co-authored-by: Tommy Reilly <[email protected]>
Co-authored-by: Joel Höner <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants