Skip to content

feat: migrate to mitol-django-observability plugin#3346

Open
blarghmatey wants to merge 1 commit intomainfrom
feat/mitol-django-observability
Open

feat: migrate to mitol-django-observability plugin#3346
blarghmatey wants to merge 1 commit intomainfrom
feat/mitol-django-observability

Conversation

@blarghmatey
Copy link
Member

Summary

Migrate to mitol-django-observability — the new shared plugin that consolidates OpenTelemetry tracing and structured logging configuration.

Changes

  • Remove main/telemetry.pyconfigure_opentelemetry() is now called automatically by the plugin
  • Remove LOGGING dict from settings.py — provided by the plugin via mitol.observability.settings.logging
  • Add mitol.observability.apps.ObservabilityConfig to INSTALLED_APPS
  • Update pyproject.toml: add mitol-django-observability dep, remove direct opentelemetry-api/sdk/exporter deps

Before / After

Before: ~120 lines of boilerplate OTel + logging setup across telemetry.py, apps.py, and settings.py
After: One entry in INSTALLED_APPS + one import

Depends on

Requires mitol-django-observability to be published to PyPI (see ol-django#407).

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>
@github-actions
Copy link

github-actions bot commented Mar 2, 2026

OpenAPI Changes

Show/hide ## Changes for v0.yaml:
## Changes for v0.yaml:


## Changes for v1.yaml:


## Changes for v2.yaml:


Unexpected changes? Ensure your branch is up-to-date with main (consider rebasing).

Copy link
Contributor

@dsubak dsubak left a comment

Choose a reason for hiding this comment

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

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",
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

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