Skip to content

chore(otel): delete a dead flag and fix a setting name that was never read - #3859

Open
blarghmatey wants to merge 4 commits into
mainfrom
tmacey/otel-dead-config
Open

chore(otel): delete a dead flag and fix a setting name that was never read#3859
blarghmatey wants to merge 4 commits into
mainfrom
tmacey/otel-dead-config

Conversation

@blarghmatey

Copy link
Copy Markdown
Member

What are the relevant tickets?

N/A — found while auditing OTel adoption across the SOA stack. Paired with the ol-infrastructure PR that drops the same flag from the Pulumi stacks, and with mitodl/mit-learn#3783 which makes the same two edits there.

Description (What does it do?)

Two OTel settings that looked live and were not.

  • OPENTELEMETRY_ENABLED — deleted. Read by nothing. mitol-django-observability decides whether to trace from the presence of an endpoint; there is no enable flag. It was also set to "true" in every Pulumi stack, so anyone reaching for it to shed load during an incident would have turned tracing "off" and watched it keep running.
  • OPENTELEMETRY_TRACES_BATCH_SIZEOPENTELEMETRY_BATCH_SIZE. telemetry.py reads OPENTELEMETRY_BATCH_SIZE, so the old name resolved to nothing and the 512 default applied no matter what it was set to.

On the rename: the alternative was to accept both names in the shared library. One name is easier to reason about than two, learn-ai already uses the correct one, and this repo is the only other place it appears — so renaming here converges everything on a single name rather than adding a permanent alias.

OPENTELEMETRY_INSECURE is deliberately left alone. It is only consulted on the gRPC export path and no app sets OPENTELEMETRY_USE_GRPC, so it currently does nothing — but it is a working option rather than a dead one, and removing it would mean removing gRPC support.

How can this be tested?

No behaviour change is expected from either edit — that is the point of the first one, and the second only makes an already-default value settable again.

  • OPENTELEMETRY_ENABLED: rg OPENTELEMETRY_ENABLED returns nothing outside the comment explaining its removal, and nothing in mitol-django-observability ever read it.
  • OPENTELEMETRY_BATCH_SIZE: confirm the new name matches the library's lookup in mitol/observability/telemetry.py. After deploy, setting it to something other than 512 should now actually change the BatchSpanProcessor batch size, which it previously could not.

pre-commit (ruff, ruff-format, detect-secrets) passes.

Additional Context

Ordering does not matter between this and the ol-infrastructure PR: the flag is inert on both sides, so removing it from one before the other changes nothing.

… read

Two OTel settings that looked live and were not.

OPENTELEMETRY_ENABLED is read by nothing. mitol-django-observability decides
whether to trace from the presence of an endpoint; there is no enable flag.
Setting this to false during an incident would have left tracing running, which
is the worst way to find out a knob is decorative.

OPENTELEMETRY_TRACES_BATCH_SIZE is not the name telemetry.py looks up -- it
reads OPENTELEMETRY_BATCH_SIZE -- so the 512 default applied no matter what this
was set to. Renamed rather than aliased in the library: one name is easier to
reason about than two, and learn-ai already uses the right one.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013SrNkjjjDiSoQkJRvDJMTC
@github-actions

github-actions Bot commented Aug 17, 2026

Copy link
Copy Markdown

OpenAPI Changes

Show/hide changes
## Changes for v0.yaml:
No changes detected

## Changes for v1.yaml:
No changes detected

## Changes for v2.yaml:
No changes detected

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Corrects inert OpenTelemetry configuration and aligns MITx Online with the shared observability library.

Changes:

  • Removes the unused enable flag.
  • Renames the trace batch-size setting to the consumed name.
  • Updates Review App configuration accordingly.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
main/settings.py Corrects OpenTelemetry settings and documents activation behavior.
app.json Aligns exposed environment variables with Django settings.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread main/settings.py Outdated
The OTEL_EXPORTER_OTLP_* wildcard promised more than the released
mitol-django-observability delivers: it reads OTEL_EXPORTER_OTLP_ENDPOINT and
nothing else in that family. As incident guidance that is worse than saying
less, since it points at a variable that would not turn tracing on.
Both comments narrated what the previous settings did and why they were wrong.
That belongs in the commit that removed them, not in a file someone reads to
find out how tracing is configured today. Keep the live constraints -- which
variables enable tracing, and that the setting name has to match what the
library looks up -- and drop the archaeology.
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