Skip to content

Commit

Permalink
Initial v4 version (#123)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
4 people authored Jun 13, 2023
1 parent 3391c78 commit b131a8e
Show file tree
Hide file tree
Showing 82 changed files with 1,692 additions and 3,343 deletions.
2 changes: 0 additions & 2 deletions .tool-versions

This file was deleted.

20 changes: 0 additions & 20 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,26 +55,6 @@ fix-black: .venv ; $(info $(M) running black...) @ ## Run black fixer
test: .venv ; $(info $(M) running tests...) @ ## Run tests
$Q $(POETRY) run pytest --cov-report $(TEST_COV_REP) --cov $(PACKAGE) --codeblocks -v

BENCH_ARGS?=--benchmark-only
BENCH_CMP?=0001

.PHONY: benchmark
benchmark: .venv ; $(info $(M) running benchmarks...) @ ## Run and save benchmark
$Q $(POETRY) run pytest ${BENCH_ARGS} --benchmark-autosave

.PHONY: benchmark-cmp
benchmark-cmp: .venv ; $(info $(M) running benchmark and comparing to ${BENCH_CMP}...) @ ## Run a benchmark and compare it to a previous one
$Q $(POETRY) run pytest ${BENCH_ARGS} --benchmark-compare=${BENCH_CMP}

PROF_DIR:=.prof
PROF_FILE:=${PROF_DIR}/$(shell date +%H%M%S).prof

.PHONY: profile
profile: .venv ; $(info $(M) running profiling...) @ ## Create profile with benchmarks and visualize with snakeviz
$Q mkdir -p ${PROF_DIR}
$Q $(POETRY) run python -m cProfile -o ${PROF_FILE} -m pytest ${BENCH_ARGS}
$Q $(POETRY) run snakeviz ${PROF_FILE}

.PHONY: release
release: lint test ; $(info $(M) running tests...) @ ## Release to PYPI
$Q $(POETRY) publish --build --username=__token__ --password=$(PYPI_TOKEN)
Expand Down
Loading

0 comments on commit b131a8e

Please sign in to comment.