-
Notifications
You must be signed in to change notification settings - Fork 969
Update profiles specification README.md and pprof.md #4932
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
base: main
Are you sure you want to change the base?
Changes from 5 commits
e06176d
3173d78
9db6b9b
a7bfa13
6b4382e
fe13670
763e2a6
ec245d1
73ace80
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -6,47 +6,80 @@ path_base_for_github_subdir: | |||||
|
|
||||||
| # OpenTelemetry Profiles | ||||||
|
|
||||||
| **Status**: [Development](../document-status.md) | ||||||
|
|
||||||
| > [!NOTE] | ||||||
| > | ||||||
| > The profiles signal is still experimental and under active development. | ||||||
| > Breaking changes may be introduced in future versions. | ||||||
|
|
||||||
| <details> | ||||||
| <summary>Table of Contents</summary> | ||||||
|
|
||||||
| <!-- toc --> | ||||||
|
|
||||||
| - [Overview](#overview) | ||||||
| - [Design goals](#design-goals) | ||||||
| - [Data Model](#data-model) | ||||||
| - [Known values](#known-values) | ||||||
| - [Specifications](#specifications) | ||||||
| - [References](#references) | ||||||
|
|
||||||
| <!-- tocstop --> | ||||||
|
|
||||||
| </details> | ||||||
|
|
||||||
| ## Overview | ||||||
|
|
||||||
| Profiles are emerging as the fourth essential signal of observability, alongside | ||||||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I previously moved this overview to the Profiles concepts page. |
||||||
| logs, metrics, and traces. They offer unparalleled insights into system and | ||||||
| application behavior, often uncovering performance bottlenecks overlooked by | ||||||
| other signals. | ||||||
|
|
||||||
| Profiles provide granular, time-based views of resource consumption and | ||||||
| code execution, encompassing: | ||||||
|
|
||||||
| * **Application-level profiling**: Reveals how software functions consume CPU, | ||||||
| memory, and other resources, highlighting slow or inefficient code. | ||||||
|
|
||||||
| * **System-level profiling**: Offers a holistic view of the infrastructure, | ||||||
| pinpointing issues in operating system calls, kernel operations, and I/O. | ||||||
|
|
||||||
| This performance picture can lead to: | ||||||
|
|
||||||
| * **Faster Root Cause Analysis**: Quickly identifies the exact cause of | ||||||
| performance degradation. | ||||||
| * **Proactive Optimization**: Identifies potential issues before user impact. | ||||||
| * **Improved Resource Utilization**: Optimizes infrastructure for cost savings | ||||||
| and efficiency. | ||||||
| * **Enhanced Developer Productivity**: Helps developers validate code performance | ||||||
| and prevent regressions. | ||||||
|
|
||||||
| In essence, while logs, metrics, and traces show "what" and "how much/where" | ||||||
| profiles explain "why" and "how efficiently" making them indispensable in modern | ||||||
| observability. | ||||||
| A **profile** is a collection of stack traces with associated values | ||||||
| representing resource consumption, collected from a running program. Profiling | ||||||
christos68k marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
| is the process of collecting such profiles, typically by sampling program state | ||||||
| at regular intervals. | ||||||
|
|
||||||
| For a general introduction to OpenTelemetry profiling and how it complements other | ||||||
| observability signals, see [Profiles concepts](https://opentelemetry.io/docs/concepts/signals/profiles/). | ||||||
|
|
||||||
| ## Design goals | ||||||
|
|
||||||
| The profiles signal is designed with the following goals in mind: | ||||||
|
|
||||||
| - **Low overhead**: Enable profiling agents to operate continuously in production | ||||||
| environments without materially impacting application performance. | ||||||
| - **Efficient representation**: Reduces volume of data stored and transmitted, | ||||||
| by using dictionary tables to deduplicate repeated information across samples. | ||||||
| - **Compatibility with existing formats**: The data model is a superset of | ||||||
| established profiling formats such as [pprof](https://github.com/google/pprof) | ||||||
| and in most cases supports lossless conversions to and from these formats. | ||||||
| If that's not possible (e.g. custom extensions), the `original_payload_format` | ||||||
| field can be used to transmit the original information for future lossless | ||||||
| export or reinterpretation. | ||||||
| - **Correlation with other signals**: Profiles MUST be linkable to logs, metrics | ||||||
| and traces through shared resource context and, where applicable, | ||||||
| direct trace/span references. This is the primary differentiator of OpenTelemetry | ||||||
| profiles compared to standalone profiling solutions. | ||||||
christos68k marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
|
|
||||||
| ## Data model | ||||||
christos68k marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
|
|
||||||
| The OpenTelemetry profiles data model is defined [here](./data-model.md). | ||||||
| It builds on the [pprof protobuf format](https://github.com/google/pprof/tree/main/proto) | ||||||
| and extends it with: | ||||||
|
|
||||||
| - **Resource and scope context**: Each batch of profiles is associated with a | ||||||
| [Resource](../resource/README.md) and an [InstrumentationScope](../common/instrumentation-scope.md), | ||||||
| consistent with logs, metrics and traces. | ||||||
| - **Generalized dictionary**: Deduplicates not only strings but also other messages | ||||||
| that exhibit redundancy. | ||||||
| - **Generalized attributes**: Most messages can carry attributes following the | ||||||
| same conventions as other signals, augmented with Unit information (`KeyValueAndUnit`). | ||||||
|
Comment on lines
+71
to
+72
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As the topic around KeyValueAndUnit is under discussion and there will be some change, we should not point it out here. To me, its an implementation detail rather than a key concept in the data model.
Suggested change
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we absolutely need to mention this here for two main reasons:
I think one job of the spec is to clarify such corner cases instead of hiding them. Moreover, this is not just an implementation detail but a core aspect of the data model, which I'll also try to explain in |
||||||
| - **Span context references**: Samples MAY include a `Link` (span ID and trace ID), | ||||||
| enabling direct linking between a profile sample and the trace/span during | ||||||
| which it was captured. | ||||||
|
|
||||||
| For details on the required attributes for `Mapping` messages and the custom | ||||||
| hashing scheme for build id generation, see [Mappings](./mappings.md). | ||||||
|
|
||||||
| For more information on compatibility with [pprof](https://github.com/google/pprof), | ||||||
| see [pprof](./pprof.md). | ||||||
|
|
||||||
| ## Known values | ||||||
|
|
||||||
|
|
@@ -61,3 +94,16 @@ tools, known values are utilized. | |||||
| | Profile field | Known values | | ||||||
| | ------------- | ------------ | | ||||||
| | original_payload_format | [pprof](https://github.com/google/pprof/tree/main/proto), [jfr](https://en.wikipedia.org/wiki/JDK_Flight_Recorder) or [linux_perf](https://perfwiki.github.io/) | | ||||||
|
|
||||||
| ## Specifications | ||||||
|
|
||||||
| * [Profiles Data Model](./data-model.md) | ||||||
| * [Profiles Mappings Attributes](./mappings.md) | ||||||
| * [Profiles Pprof Compatibility](./pprof.md) | ||||||
|
|
||||||
| ## References | ||||||
|
|
||||||
| - [Profiles Concepts](https://opentelemetry.io/docs/concepts/signals/profiles/) | ||||||
| - [Profiles Semantic Conventions](https://opentelemetry.io/docs/specs/semconv/general/profiles/) | ||||||
| - [OTEP0212 OpenTelemetry Profiles Vision](../../oteps/profiles/0212-profiling-vision.md) | ||||||
| - [OTEP0239 OpenTelemetry Profiles Data Model](../../oteps/profiles/0239-profiles-data-model.md) | ||||||
christos68k marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,10 +10,11 @@ | |
|
|
||
| ## Compatibility | ||
|
|
||
| Original [pprof](https://github.com/google/pprof/tree/main/proto) is forward | ||
| compatible with OpenTelemetry Profiles in a sense that it can be transformed into | ||
| OpenTelemetry Profiles and again into [pprof](https://github.com/google/pprof/tree/main/proto) | ||
| without data loss. | ||
| Original [pprof](https://github.com/google/pprof/tree/main/proto) is compatible | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we merge this pprof.md file into the README.md, as a section? It's not a lot of text, so it might be easier to just have the single README.md file.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Given that we want really good integration with pprof due to its importance, I was thinking we'd want to expand the pprof information at some point, once we have a better/clearer story to tell there regarding conversions, recommendations, maybe an example and so on. In that way it's similar to
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point about expanding this at some point and the separate file being a nudge. SG to keep it separate. |
||
| with OpenTelemetry Profiles in that it can be transformed into OpenTelemetry Profiles | ||
| and back again into [pprof](https://github.com/google/pprof/tree/main/proto) without | ||
| data loss (convertibility but not wire compatibility). | ||
|
|
||
| To enable this compatibility through explicit conversion, OpenTelemetry provides pprof-specific [guidelines](https://opentelemetry.io/docs/specs/semconv/general/profiles/#compatibility-with-pprof) | ||
| in [Semantic Conventions](https://opentelemetry.io/docs/specs/semconv). | ||
|
|
||
| For this compatibility OpenTelemetry also provides a `pprof` namespace in | ||
| Semantic Conventions. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should rephrase this note to sound less concerning.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the same preamble as the one I added in Profiles concepts (which already went live). Since the signal isn't yet Alpha, I think this is more accurate.
We can update this to Alpha shortly before or immediately after the announcement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. It's not yet marked as alpha (see this PR).
But maybe we don't need this whole paragraph since the Status is already declared above. Other documents with status "Development" don't seem to have such a Notes section either.
Anyway, since it's already in the other doc, I'm also fine with keeping it for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably gather ourselves a list of all places that need to be coherently updated on the Alpha day.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added open-telemetry/sig-profiling#83