[pdata/pprofile] Add reference based attributes support#14546
Conversation
Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #14546 +/- ##
==========================================
+ Coverage 91.46% 91.47% +0.01%
==========================================
Files 688 689 +1
Lines 43824 43975 +151
==========================================
+ Hits 40084 40228 +144
+ Misses 2629 2627 -2
- Partials 1111 1120 +9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
|
@florianl have you been able to run any benchmarks? I would be curious to see what's the end-to-end performance impact when using this approach vs the implementation that doesn't resolve references in a config with a bare otlp-receiver/otlp-exporter pipeline. |
Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
@florianl can you please help interpret this? After the change the code is doing strictly more work if I understand correctly. So how can it it be 10% faster? |
BenchmarkProfilesToProto and BenchmarkProfilesFromProto are two existing benchmarks in the codebase. Both use the function generateBenchmarkProfiles that generates profiles with a given number of samples - no attributes, no resources, no dictionary entries. So in these cases no conversion is happening as there is no data that could be converted. I kept these two benchmarks as they are part of the codebase already and if the new code introduces a regression, I wanted to see that.
My assumption is, that the compiler refactors the code and for the case where there are "empty" profiles - no attributes, no resources, no use of the dictionary - it performs better. @tigrannajaryan I hope this helps to put the benchmark results into perspective. I'm happy to add these new benchmarks to the codebase - please let me know. |
Yes, if you think the new benchmarks are a more valid comparison it would be good to see the results. |
Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
|
The results of these new benchmarks are shown in #14546 (comment) - see |
Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
Ahh, sorry I misunderstood the benchmarks. So, from what I see there is virtually no penalty in the unmarshalling part and about 14% penalty in marshalling of small payloads. This seems acceptable to me. My only concern would be to double check the benchmarks are correct. For example looking at |
|
@florianl in my opinion 14% marshalling speed penalty is an acceptable tradeoff to avoid the complexity of adding reference support to pdata API. My only remaining concern is that I am not sure I understand why benchmarks don't show increase in memory allocations, which makes them suspect. If you can double check the benchmarks and explain what's going on then I am fully on board with this approach. |
Per the proto spec [1], key and key_ref are mutually exclusive on the wire. Without clearing Key after setting KeyRef, both fields would be serialized, violating the MUST NOT constraint and wasting bytes. [1] open-telemetry/opentelemetry-proto#733
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>
|
We should have a collector-contrib PR ready to be merged fixing the breaking changes. |
|
@dmathieu the respective collector contrib PR is open-telemetry/opentelemetry-collector-contrib#46331 |
c85224a
This is a complementary change for open-telemetry/opentelemetry-collector#14546. With the change in the Profiling signal, the data in input.yaml no longer meets the expected format. Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
This is a complementary change for open-telemetry/opentelemetry-collector#14546. With the change in the Profiling signal, the data in input.yaml no longer meets the expected format. Without open-telemetry/opentelemetry-collector#14546 being merged, this PR is expected to fail tests in connector/countconnector. <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description <!-- Issue number (e.g. #1234) or full URL to issue, if applicable. --> #### Link to tracking issue Fixes <!--Describe what testing was performed and which tests were added.--> #### Testing <!--Describe the documentation added.--> #### Documentation <!--Please delete paragraphs that you did not use before submitting.--> --------- Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description open-telemetry/opentelemetry-proto#733 and open-telemetry/opentelemetry-collector#14546 are about to change how pprofiles work. As the input is changed in memory during the marshaling operation, it can no longer be used directly to validate the output. FYI: @felixge <!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. --> #### Link to tracking issue Fixes <!--Describe what testing was performed and which tests were added.--> #### Testing <!--Describe the documentation added.--> #### Documentation <!--Please delete paragraphs that you did not use before submitting.--> --------- Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
Description
Draft implementation for open-telemetry/opentelemetry-proto#733 that shows the transparent conversion between reference based attributes and pdata API.
With open-telemetry/opentelemetry-collector-contrib#46331 there is the respective change that fixes the failing tests in connector/countconnector.
FYI: @open-telemetry/profiling-approvers @tigrannajaryan @bogdandrutu