From 27ddb0814948995969ba7a650029cadc5b563827 Mon Sep 17 00:00:00 2001 From: Florian Lehner Date: Thu, 13 Nov 2025 09:59:55 +0100 Subject: [PATCH 1/2] pprof: add profile attribute Add pprof specific attributes to help convert pprof to OTel profiles and vice versa. Signed-off-by: Florian Lehner --- .chloggen/pprof-profile.yaml | 22 ++++++++++++++++++++++ docs/registry/attributes/pprof.md | 4 ++++ model/pprof/registry.yaml | 30 ++++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+) create mode 100755 .chloggen/pprof-profile.yaml diff --git a/.chloggen/pprof-profile.yaml b/.chloggen/pprof-profile.yaml new file mode 100755 index 0000000000..754afe3d24 --- /dev/null +++ b/.chloggen/pprof-profile.yaml @@ -0,0 +1,22 @@ +# Use this changelog template to create an entry for release notes. +# +# If your change doesn't affect end users you should instead start +# your pull request title with [chore] or use the "Skip Changelog" label. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: 'enhancement' + +# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db) +component: pprof + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: add various pprof attributes to support lossless conversion from and to OTel profiles. + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +# The values here must be integers. +issues: [3078] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: diff --git a/docs/registry/attributes/pprof.md b/docs/registry/attributes/pprof.md index e080eb6e29..a5712b2ee4 100644 --- a/docs/registry/attributes/pprof.md +++ b/docs/registry/attributes/pprof.md @@ -17,3 +17,7 @@ Attributes specific to pprof that help convert from pprof to Profiling signal. | `pprof.mapping.has_inline_frames` | ![Development](https://img.shields.io/badge/-development-blue) | boolean | Indicates that there are inline frames related to this mapping. | | | `pprof.mapping.has_line_numbers` | ![Development](https://img.shields.io/badge/-development-blue) | boolean | Indicates that there are line numbers related to this mapping. | | | `pprof.profile.comment` | ![Development](https://img.shields.io/badge/-development-blue) | 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` | ![Development](https://img.shields.io/badge/-development-blue) | string[] | Type of the preferred sample value. | `["cpu", "nanoseconds"]` | +| `pprof.profile.doc_url` | ![Development](https://img.shields.io/badge/-development-blue) | string | Documentation link for this profile type. | `http://pprof.example.com/cpu-profile.html` | +| `pprof.profile.drop_frames` | ![Development](https://img.shields.io/badge/-development-blue) | string | Frames with Function.function_name fully matching the regexp will be dropped from the samples, along with their successors. | `/foobar/` | +| `pprof.profile.keep_frames` | ![Development](https://img.shields.io/badge/-development-blue) | string | Frames with Function.function_name fully matching the regexp will be kept, even if it matches drop_frames. | `/bazinga/` | diff --git a/model/pprof/registry.yaml b/model/pprof/registry.yaml index 3410ed7b54..3f4cfab810 100644 --- a/model/pprof/registry.yaml +++ b/model/pprof/registry.yaml @@ -44,3 +44,33 @@ groups: examples: - ["hello world", "bazinga"] stability: development + - id: pprof.profile.drop_frames + brief: > + Frames with Function.function_name fully matching the regexp will be + dropped from the samples, along with their successors. + type: string + examples: + - "/foobar/" + stability: development + - id: pprof.profile.keep_frames + brief: > + Frames with Function.function_name fully matching the regexp will be + kept, even if it matches drop_frames. + type: string + examples: + - "/bazinga/" + stability: development + - id: pprof.profile.doc_url + brief: > + Documentation link for this profile type. + type: string + examples: + - "http://pprof.example.com/cpu-profile.html" + stability: development + - id: pprof.profile.default_sample_type + brief: > + Type of the preferred sample value. + type: string[] + examples: + - ["cpu", "nanoseconds"] + stability: development From 8618848c44a0671e28909d58bacf4f617f04a179 Mon Sep 17 00:00:00 2001 From: Florian Lehner Date: Fri, 14 Nov 2025 16:03:10 +0100 Subject: [PATCH 2/2] apply feedback Signed-off-by: Florian Lehner --- docs/general/profiles.md | 6 ++++++ docs/registry/attributes/pprof.md | 6 ++++-- model/pprof/common.yaml | 8 ++++++++ model/pprof/registry.yaml | 7 +++++-- 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/docs/general/profiles.md b/docs/general/profiles.md index b52b0aeb08..30948d109b 100644 --- a/docs/general/profiles.md +++ b/docs/general/profiles.md @@ -86,6 +86,12 @@ They may be used in any Profiles record they apply to. | [`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` | +| [`pprof.profile.doc_url`](/docs/registry/attributes/pprof.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | Documentation link for this profile type. [1] | `http://pprof.example.com/cpu-profile.html` | +| [`pprof.profile.drop_frames`](/docs/registry/attributes/pprof.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | Frames with Function.function_name fully matching the regexp will be dropped from the samples, along with their successors. | `/foobar/` | +| [`pprof.profile.keep_frames`](/docs/registry/attributes/pprof.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | Frames with Function.function_name fully matching the regexp will be kept, even if it matches drop_frames. | `/bazinga/` | + +**[1] `pprof.profile.doc_url`:** The URL must be absolute and may be missing if the profile was generated by code that did not supply a link diff --git a/docs/registry/attributes/pprof.md b/docs/registry/attributes/pprof.md index a5712b2ee4..d3192d5d71 100644 --- a/docs/registry/attributes/pprof.md +++ b/docs/registry/attributes/pprof.md @@ -17,7 +17,9 @@ Attributes specific to pprof that help convert from pprof to Profiling signal. | `pprof.mapping.has_inline_frames` | ![Development](https://img.shields.io/badge/-development-blue) | boolean | Indicates that there are inline frames related to this mapping. | | | `pprof.mapping.has_line_numbers` | ![Development](https://img.shields.io/badge/-development-blue) | boolean | Indicates that there are line numbers related to this mapping. | | | `pprof.profile.comment` | ![Development](https://img.shields.io/badge/-development-blue) | 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` | ![Development](https://img.shields.io/badge/-development-blue) | string[] | Type of the preferred sample value. | `["cpu", "nanoseconds"]` | -| `pprof.profile.doc_url` | ![Development](https://img.shields.io/badge/-development-blue) | string | Documentation link for this profile type. | `http://pprof.example.com/cpu-profile.html` | +| `pprof.profile.default_sample_type` | ![Development](https://img.shields.io/badge/-development-blue) | string | Type of the preferred sample value. | `cpu` | +| `pprof.profile.doc_url` | ![Development](https://img.shields.io/badge/-development-blue) | string | Documentation link for this profile type. [1] | `http://pprof.example.com/cpu-profile.html` | | `pprof.profile.drop_frames` | ![Development](https://img.shields.io/badge/-development-blue) | string | Frames with Function.function_name fully matching the regexp will be dropped from the samples, along with their successors. | `/foobar/` | | `pprof.profile.keep_frames` | ![Development](https://img.shields.io/badge/-development-blue) | string | Frames with Function.function_name fully matching the regexp will be kept, even if it matches drop_frames. | `/bazinga/` | + +**[1] `pprof.profile.doc_url`:** The URL must be absolute and may be missing if the profile was generated by code that did not supply a link diff --git a/model/pprof/common.yaml b/model/pprof/common.yaml index 573c288f16..5cde1ba673 100644 --- a/model/pprof/common.yaml +++ b/model/pprof/common.yaml @@ -17,3 +17,11 @@ groups: requirement_level: recommended - ref: pprof.profile.comment requirement_level: recommended + - ref: pprof.profile.drop_frames + requirement_level: recommended + - ref: pprof.profile.keep_frames + requirement_level: recommended + - ref: pprof.profile.doc_url + requirement_level: recommended + - ref: pprof.profile.default_sample_type + requirement_level: recommended diff --git a/model/pprof/registry.yaml b/model/pprof/registry.yaml index 3f4cfab810..f5c970ca91 100644 --- a/model/pprof/registry.yaml +++ b/model/pprof/registry.yaml @@ -64,13 +64,16 @@ groups: brief: > Documentation link for this profile type. type: string + note: > + The URL must be absolute and may be missing if the profile was + generated by code that did not supply a link examples: - "http://pprof.example.com/cpu-profile.html" stability: development - id: pprof.profile.default_sample_type brief: > Type of the preferred sample value. - type: string[] + type: string examples: - - ["cpu", "nanoseconds"] + - "cpu" stability: development