-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[xscraperhelper] init package #14235
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?
Conversation
Signed-off-by: Florian Lehner <dev@der-flo.net>
9b26e18 to
2ed498e
Compare
| - cmd/mdatagen/internal/sampleprocessor | ||
| - cmd/mdatagen/internal/samplereceiver | ||
| - cmd/mdatagen/internal/samplescraper | ||
| - config/configauth |
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 part is auto-generated by make generate-gh-issue-templates. It looks like these components are missing so far.
Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
CodSpeed Performance ReportMerging #14235 will improve performances by 39.62%Comparing
|
| Benchmark | BASE |
HEAD |
Change | |
|---|---|---|---|---|
| ⚡ | BenchmarkTraceSizeSpanCount |
60 ns | 46 ns | +30.43% |
| ⚡ | BenchmarkTracesToProto2k |
96 µs | 69.7 µs | +37.66% |
| ⚡ | BenchmarkTraceSizeBytes |
430.5 µs | 317.2 µs | +35.71% |
| ⚡ | with_a_duplicate_value |
60 ns | 46 ns | +30.43% |
| ⚡ | BenchmarkTracesMarshalJSON |
6 µs | 4.7 µs | +26.05% |
| ⚡ | BenchmarkProfilesToProto |
1.7 µs | 1.3 µs | +29.26% |
| ⚡ | BenchmarkLogsToProto2k |
63.2 µs | 45.3 µs | +39.62% |
Footnotes
-
20 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (94.90%) is below the target coverage (95.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #14235 +/- ##
==========================================
+ Coverage 92.17% 92.18% +0.01%
==========================================
Files 668 674 +6
Lines 41510 41679 +169
==========================================
+ Hits 38262 38422 +160
- Misses 2215 2220 +5
- Partials 1033 1037 +4 ☔ 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>
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>
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>
|
It looks like xscraperhelper duplicates a lot of code from scraperhelper, which is probably why the PR is so large. This is not ideal, since it makes maintenance a lot more difficult (any change in scraperhelper would have to be copied over to xscraperhelper). I think a better approach would be to move the "generic" components used in all signals into |
Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
|
@jade-guiton-dd with 92bc761 I have started to deduplicate code. But the win of deduplication is limited. While it seems that a good portion of code is duplicate, they differ in essential elements, like |
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>
|
Good catch with the |
Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
|
@jade-guiton-dd I'm about to revert 71b753d - the move of parts of controller into a dedicated shared package. In other parts of the OTel collector, like xreceiver, xscraper, xconsumer, xprocessor and others, the code duplication was not a problem. The x-prefixed packages are seen to be temporarily until the profiling Signal becomes more stable, while keeping the rest of OTel collector stable. Is the situation here different? |
I think moving exported types/functions like
I'm not sure. I would say those packages contain less functional code than a helper like |
|
It sounds like for the other |
Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
|
@jade-guiton-dd with using scraperhelper in xscraperhelper I was able to remove the duplicate code around ControllerConfig. For Hope this approach works for you. WDYT? |
|
The solution here would be to move If that still doesn't work, I won't insist further on deduplication, but I'd rather avoid maintenance hell later, even if we've been more lenient for |
This option will not work, as Do you want to see a non-internal subpackage, like |
I don't understand, would it not work if |
Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
|
I have updated the PR, moved the code into an internal package and used type aliasing as well as a function wrapper, to not break the API. |
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.
It's difficult giving a thorough review on so much code, but after comparing with the old code it seems cogent. I just have a few questions and comments.
| } | ||
|
|
||
| spans := tel.SpanRecorder.Ended() | ||
| testhelper.AssertScraperSpan(t, test.scrapeErr, spans, "scraper/scraper/ScrapeProfiles") |
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.
I saw the logs/metrics versions of this file have a call to assertReceiverSpan(t, spans) here. Was it removed on purpose because of the missing receiverhelper telemetry, or was it a mistake?
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.
scrapeProfiles() does not emit this data atm therefore assertReceiverSpan(t, spans) was removed.
Currently scrapeProfiles() can not generate this data, as #14251 is still not merged.
As #14251 is in another package and independent from this PR, I didn't want to mix things and created a dedicated PR.
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>
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>
Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
Description
Along with
scraper/xscraperthis package is needed to enable OTel Profiling signal receivers, such as receiver/pprofreceiver.Link to tracking issue
Fixes #
Testing
Documentation