Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .idea/bootstrap-python-fastapi.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 13 additions & 33 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ optional = true
[tool.poetry.group.http.dependencies]
fastapi = ">=0.99.0"
jinja2 = "^3.1.2"
opentelemetry-instrumentation-fastapi = "*"
# We use the generic ASGI instrumentation, so that if we decide to change
# Framework it will still work consistently.
opentelemetry-instrumentation-asgi = "*"
starlette-prometheus = "^0.10.0"
strawberry-graphql = { version = ">=0.204.0", extras = ["debug-server"] }
uvicorn = { version = "^0.31.0", extras = ["standard"] }
Expand Down
9 changes: 9 additions & 0 deletions src/celery_worker/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
without having to initialise the HTTP framework (or other ones)
"""

from celery.signals import worker_process_init
from opentelemetry.instrumentation.celery import CeleryInstrumentor

from bootstrap import AppConfig, application_init


@worker_process_init.connect(weak=False)
def init_celery_tracing(*args, **kwargs):
CeleryInstrumentor().instrument() # pragma: nocover


app = application_init(AppConfig()).celery_app