Skip to content

[receiver/pprof] initial commit to convert google/pprof to OTel profiles#42843

Merged
atoulme merged 23 commits into
open-telemetry:mainfrom
florianl:receiver-pprof
Oct 23, 2025
Merged

[receiver/pprof] initial commit to convert google/pprof to OTel profiles#42843
atoulme merged 23 commits into
open-telemetry:mainfrom
florianl:receiver-pprof

Conversation

@florianl
Copy link
Copy Markdown
Member

Follow up to #40548

FYI: @atoulme @felixge @aalexand

TODO:

  • verify result
  • more tests

Follow up to open-telemetry#40548

TODO:
- [ ] verify result
- [ ] more tests

Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
const (
// noAttrUnit is a helper to indicate that no
// unit is associated to this Attribute.
noAttrUnit = int32(-1)
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.

Can this be a zero? I think with the "zero index == null" convention we've been trying to avoid having to use -1 as a special value.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

noAttrUnit is just an conversion internal helper and will not be seen in the resulting OTel profiles output. As every positive value can indicate a unit, i needed something to indicate that no unit is set for this attribute.

Comment thread receiver/pprofreceiver/convert.go Outdated
Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
Comment thread receiver/pprofreceiver/convert_test.go
Comment thread receiver/pprofreceiver/convert.go Outdated
Comment thread receiver/pprofreceiver/convert.go Outdated
Comment thread receiver/pprofreceiver/convert.go Outdated
@atoulme
Copy link
Copy Markdown
Contributor

atoulme commented Oct 2, 2025

Thank you for this work. A nit on the test code, and a few notes on the TODOs in the code. Do you want to address the TODOs in this PR or deal with them in other PRs?

lastFunctionTableIdx int32
}

func convertPprofToPprofile(src *profile.Profile) (*pprofile.Profiles, error) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not a blocker for this PR, but if we are willing to add a pprof exporter, we could consider moving this to a pprof translator package

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

maybe @MovieStoreGuy or @atoulme can answer the question on why they chose to create receiver/pprofreceiver over a translator package.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The receiver allows us to start small, as things get shared we can move things into seperate packages.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the proof is in the pudding - a translator package is great once we see this working

Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
@florianl
Copy link
Copy Markdown
Member Author

florianl commented Oct 3, 2025

[..] a few notes on the TODOs in the code. Do you want to address the TODOs in this PR or deal with them in other PRs?

@atoulme the TODOs were a reminder for myself to discuss the topic of the id fields from pprof with the Profiling SIG. As this is not relevant for this PR, I have removed them with 00333f2.

Comment thread receiver/pprofreceiver/convert.go Outdated
Comment thread receiver/pprofreceiver/convert.go Outdated
Comment thread receiver/pprofreceiver/convert.go Outdated
Comment thread receiver/pprofreceiver/convert.go Outdated
Comment thread receiver/pprofreceiver/convert.go Outdated
florianl and others added 4 commits October 17, 2025 14:18
Co-authored-by: Roger Coll <roger.coll@elastic.co>
Co-authored-by: Roger Coll <roger.coll@elastic.co>
Co-authored-by: Roger Coll <roger.coll@elastic.co>
@florianl florianl marked this pull request as ready for review October 17, 2025 12:28
@florianl florianl requested review from a team and MovieStoreGuy as code owners October 17, 2025 12:28
@florianl
Copy link
Copy Markdown
Member Author

friendly ping for feedback at @MovieStoreGuy and @atoulme

Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
github-merge-queue Bot pushed a commit to open-telemetry/opentelemetry-collector that referenced this pull request Oct 22, 2025
#### Description

Implement scraper for Profiles.

This will help implement receiver parts like
open-telemetry/opentelemetry-collector-contrib#42843.

---------

Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
@MovieStoreGuy
Copy link
Copy Markdown
Contributor

Please add a changelog entry :)

Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
@atoulme atoulme merged commit 41f14c1 into open-telemetry:main Oct 23, 2025
189 checks passed
@github-actions github-actions Bot added this to the next release milestone Oct 23, 2025
github-merge-queue Bot pushed a commit to open-telemetry/opentelemetry-collector that referenced this pull request Nov 19, 2025
#### Description

Implement scraper for Profiles.

This will help implement receiver parts like
open-telemetry/opentelemetry-collector-contrib#42843.

---------

Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
github-merge-queue Bot pushed a commit to open-telemetry/opentelemetry-collector that referenced this pull request Nov 19, 2025
#### Description

Implement scraper for Profiles.

This will help implement receiver parts like
open-telemetry/opentelemetry-collector-contrib#42843.

---------

Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
Co-authored-by: Pablo Baeyens <pablo.baeyens@datadoghq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants