Skip to content
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

Implemented span compression algorithm #1321

Merged
merged 18 commits into from
Oct 16, 2021

Conversation

beniwohli
Copy link
Contributor

What does this pull request do?

See elastic/apm#432

Related issues

closes #1152

@apmmachine
Copy link
Contributor

apmmachine commented Sep 9, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2021-10-15T22:48:36.031+0000

  • Duration: 29 min 29 sec

  • Commit: ad9bdac

Test stats 🧪

Test Results
Failed 0
Passed 10071
Skipped 8977
Total 19048

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

Copy link
Contributor

@basepi basepi left a comment

Choose a reason for hiding this comment

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

Did a brief review, everything looks good so far! I'll do a deeper review once this is ready for review.

I noticed that you haven't really refactored leaf to exit -- is that still something we want to do? I made a note here after one of our previous discussions.

def report(self) -> None:
self.tracer.queue_func(SPAN, self.to_dict())

def try_to_compress(self, sibling: SpanType) -> bool:
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe some docstrings through here so we can remember at a glance what composite vs regular means?

@beniwohli
Copy link
Contributor Author

I noticed that you haven't really refactored leaf to exit -- is that still something we want to do? I made a note here after one of our previous discussions.

I started it implementing in this branch, but soon realized that it would overload it (something that also became apparent with introducing type hints with this PR, hence I only committed the ones in tracing.py). The plan is to implement it in #1159, which is a smaller change in general, but also depends on an exit flag.

This cleans up a wart where `traceparent` is initialized to
None, and needs to be set by the callee right after, as there
is code that assumes `traceparent` to be set.
we no longer only call `child_ended` for breakdown metrics
@beniwohli beniwohli marked this pull request as ready for review September 29, 2021 14:37
Copy link
Contributor

@basepi basepi left a comment

Choose a reason for hiding this comment

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

LGTM! 👍

Copy link
Contributor

@basepi basepi left a comment

Choose a reason for hiding this comment

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

Docs look good!

beniwohli added a commit to beniwohli/apm-agent-python that referenced this pull request Oct 13, 2021
beniwohli added a commit that referenced this pull request Oct 13, 2021
@beniwohli beniwohli merged commit 9624775 into elastic:master Oct 16, 2021
@beniwohli beniwohli deleted the compress-spans branch October 16, 2021 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[META 432] Implement compressed spans algorithm
3 participants