feat: migrate to mitol-django-observability plugin#3346
feat: migrate to mitol-django-observability plugin#3346blarghmatey wants to merge 1 commit intomainfrom
Conversation
Replace bespoke OpenTelemetry + logging boilerplate with the new mitol-django-observability shared plugin. Changes: - Remove main/telemetry.py (configure_opentelemetry moved to plugin) - Remove LOGGING dict from settings.py (provided by plugin) - Add 'from mitol.observability.settings.logging import LOGGING' - Add 'mitol.observability.apps.ObservabilityConfig' to INSTALLED_APPS - Update pyproject.toml: add mitol-django-observability dep, remove direct opentelemetry-api/sdk/exporter deps Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
OpenAPI ChangesShow/hide ## Changes for v0.yaml:Unexpected changes? Ensure your branch is up-to-date with |
dsubak
left a comment
There was a problem hiding this comment.
Conceptually, this seems pretty straightforward. It'll change some logging behavior, but that's largely intentional afaict.
I'm going to hold off on formal approval until mitodl/ol-django#407 lands and I can actually start local with this branch. Since the package doesn't exist yet it just chokes on startup, which is totally expected but I do want to put it through the lightest testing ever before I put a stamp on it!
| "opentelemetry-api>=1.31.0", | ||
| "opentelemetry-exporter-otlp>=1.31.0", | ||
| "mitol-django-observability>=2026.1.0", | ||
| "opentelemetry-instrumentation-celery>=0.52b0", |
There was a problem hiding this comment.
One like... super minor concern I've got w/ the reliance on automatic instrumentation is that we no longer get big obvious failures if we screw something up (like if I were to inadvertently remove any of these otel-instrumentation-* packages).
I wonder if there's any value in adding an "expected" set of automatic instrumentations over in the plugin that is be defined by settings and throwing an error if we ever fail that?
It feels like it's probably overkill at the moment to me, but if we ended up seeing people accidentally dropping instrumentation that they don't consult every day, it might be a relatively quick and cheap way to let folks avoid surprise viz gaps.
Summary
Migrate to
mitol-django-observability— the new shared plugin that consolidates OpenTelemetry tracing and structured logging configuration.Changes
main/telemetry.py—configure_opentelemetry()is now called automatically by the pluginLOGGINGdict fromsettings.py— provided by the plugin viamitol.observability.settings.loggingmitol.observability.apps.ObservabilityConfigtoINSTALLED_APPSpyproject.toml: addmitol-django-observabilitydep, remove directopentelemetry-api/sdk/exporterdepsBefore / After
Before: ~120 lines of boilerplate OTel + logging setup across
telemetry.py,apps.py, andsettings.pyAfter: One entry in
INSTALLED_APPS+ one importDepends on
Requires
mitol-django-observabilityto be published to PyPI (see ol-django#407).