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

Add py-spy profiler support #137

Merged
merged 1 commit into from
Jun 9, 2023
Merged

Add py-spy profiler support #137

merged 1 commit into from
Jun 9, 2023

Conversation

eirsyl
Copy link
Member

@eirsyl eirsyl commented Jun 9, 2023

No description provided.

@eirsyl eirsyl requested a review from kiloreven as a code owner June 9, 2023 13:05
@eirsyl eirsyl requested review from gbbirkisson and removed request for kiloreven June 9, 2023 13:05
@eirsyl eirsyl force-pushed the troncos/v4-py-spy branch from 62f3494 to eebadf6 Compare June 9, 2023 13:07
@eirsyl eirsyl force-pushed the troncos/v4-py-spy branch from eebadf6 to 95731b3 Compare June 9, 2023 13:10
@eirsyl eirsyl merged commit 07af5ef into troncos/v4 Jun 9, 2023
@eirsyl eirsyl deleted the troncos/v4-py-spy branch June 9, 2023 13:27
Copy link
Member

@torarvid torarvid left a comment

Choose a reason for hiding this comment

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

Nice

eirsyl added a commit that referenced this pull request Jun 13, 2023
* Initial v4 version

* Django logging middleware (#124)

* Initial django logging middleware

* Add django middleware docs

* Bump version

* Celery task log (#125)

* Initial celery signals

* Add celery task logging

* Add docs (#126)

* Bump version

* Add GRPC span exporter (#127)

* Bump version

* Use BoundedAttributes when adding attributes to events

* Bump version

* Change span class

* Bump version

* Use ReadonlySpan, Span uses locks

* Bump version

* Dont use Resource.create, it tries to detect app info we dont need

* Bump version

* Add structlog logfmt renderer

* Add print_loggers helper tool

* Add decorators

* Remove required logger prefix in middleware

* Explicitly log trace_id in ASGI middleware

* Dont log empty events

* Make django profiling view sync

* Bump version

* Make translate_span a little faster (#132)

* Make translate_span a little faster

Using py-spy, it looks like the previous version spent some time doing

list(default_resource.attributes.keys()) every time it was called.

It seems this can be done once in the OTELWriter constructor instead.
Also, I think we can make it a set instead of a list (I believe `a in
my_set` is a bit quicker than `a in my_list`).

Does this commit include tests to verify the speed increase? Nah... 🤷

* isort

* Bump version

* Add some tiny performance improvements

* Drop sampled spans (#135)

* Dont write sampled spans to the otel endpoint

* Add span.sampled check

* Bump version

* Add py-spy profiler support (#137)

* Bump version

* Add basic and token auth support to py-spy profiler (#138)

* Bump version

* Add instance tag to the py-spy profiler

* Use tracer tags, this lets us reuse tags added by tracer.set_tags

---------

Co-authored-by: Guðmundur Björn Birkisson <[email protected]>
Co-authored-by: Tor Arvid Lund <[email protected]>
Co-authored-by: Tor Arvid Lund <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants