Skip to content

Conversation

@florianl
Copy link
Contributor

Changes

Add pprof specific attributes to help convert pprof to OTel profiles and vice versa.

FYI @open-telemetry/profiling-approvers

Important

Pull requests acceptance are subject to the triage process as described in Issue and PR Triage Management.
PRs that do not follow the guidance above, may be automatically rejected and closed.

Merge requirement checklist

  • CONTRIBUTING.md guidelines followed.
  • Change log entry added, according to the guidelines in When to add a changelog entry.
    • If your PR does not need a change log, start the PR title with [chore]
  • Links to the prototypes or existing instrumentations (when adding or changing conventions)

Add pprof specific attributes to help convert pprof to OTel profiles and vice versa.

Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
examples:
- "/foobar/"
stability: development
- id: pprof.profile.keep_frames
Copy link
Contributor Author

Choose a reason for hiding this comment

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

examples:
- ["hello world", "bazinga"]
stability: development
- id: pprof.profile.drop_frames
Copy link
Contributor Author

Choose a reason for hiding this comment

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

examples:
- "/bazinga/"
stability: development
- id: pprof.profile.doc_url
Copy link
Contributor Author

Choose a reason for hiding this comment

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

examples:
- "http://pprof.example.com/cpu-profile.html"
stability: development
- id: pprof.profile.default_sample_type
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@florianl florianl moved this from Untriaged to Awaiting codeowners approval in Semantic Conventions Triage Nov 13, 2025
@thompson-tomo
Copy link
Contributor

Should these new attributes also appear on the profiles page in the compatibility section?

Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
| [`pprof.mapping.has_inline_frames`](/docs/registry/attributes/pprof.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | boolean | Indicates that there are inline frames related to this mapping. | |
| [`pprof.mapping.has_line_numbers`](/docs/registry/attributes/pprof.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | boolean | Indicates that there are line numbers related to this mapping. | |
| [`pprof.profile.comment`](/docs/registry/attributes/pprof.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string[] | Free-form text associated with the profile. This field should not be used to store any machine-readable information, it is only for human-friendly content. | `["hello world", "bazinga"]` |
| [`pprof.profile.default_sample_type`](/docs/registry/attributes/pprof.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | Type of the preferred sample value. | `cpu` |
Copy link
Member

Choose a reason for hiding this comment

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

What attributes map will carry this attribute? Instrumentation scope?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ResourceProfiles.resource.attributes might be the best location to set this attribute.

Copy link
Member

Choose a reason for hiding this comment

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

A single resource contains "repeated ScopeProfiles scope_profiles" and each of those has "repeated Profile profiles". The default could be in theory different for different scopes I think.

Copy link
Member

Choose a reason for hiding this comment

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

Also, should the second part in the attribute name reflect where the attribute is set? That is:

  • pprof.resource.* for resource_profiles[].resource.attributes[]
  • pprof.scope.* for resource_profiles[].scope_profiles[].scope.attributes[]
  • pprof.profile.* for resource_profiles[].scope_profiles[].profiles[].attribute_indices[]

?

Copy link
Member

Choose a reason for hiding this comment

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

Applying these attributes at the instrumentation scope level makes sense to me 👍

@aalexand
Copy link
Member

@florianl For the default sample type and sample type order handling in the conversion, I wrote up some notes here, could you take a look?

| [`pprof.mapping.has_inline_frames`](/docs/registry/attributes/pprof.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | boolean | Indicates that there are inline frames related to this mapping. | |
| [`pprof.mapping.has_line_numbers`](/docs/registry/attributes/pprof.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | boolean | Indicates that there are line numbers related to this mapping. | |
| [`pprof.profile.comment`](/docs/registry/attributes/pprof.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string[] | Free-form text associated with the profile. This field should not be used to store any machine-readable information, it is only for human-friendly content. | `["hello world", "bazinga"]` |
| [`pprof.profile.default_sample_type`](/docs/registry/attributes/pprof.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | Type of the preferred sample value. | `cpu` |
Copy link
Member

Choose a reason for hiding this comment

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

I think we should add a sample_type_order field as initially suggested in this comment, further clarified in this one as well as @aalexand's document.

AFAIR we had consensus on this already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Awaiting codeowners approval

Development

Successfully merging this pull request may close these issues.

6 participants