Skip to content

Conversation

florianl
Copy link
Contributor

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
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
Contributor 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.

Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
@atoulme
Copy link
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
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
Contributor 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.

Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
@florianl
Copy link
Contributor 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.


// getIdxForFunction returns the corresponding index for the function.
// If the function does not yet exist in the cache, it will be adedd.
func getIdxForFunction(lts lookupTables, name, systemName, fileName string, startLine int64) int32 {
Copy link
Contributor

Choose a reason for hiding this comment

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

The methods below mutate the lookupTables struct, shouldn't this be a reference instead? What about moving them to be a lookupTable's method instead?

Suggested change
func getIdxForFunction(lts lookupTables, name, systemName, fileName string, startLine int64) int32 {
func (lts *lookupTables) getIdxForFunction(name, systemName, fileName string, startLine int64) int32 {

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
Contributor Author

friendly ping for feedback at @MovieStoreGuy and @atoulme

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>
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.

5 participants