chore(otel): delete a dead flag and fix a setting name that was never read - #3859
Open
blarghmatey wants to merge 4 commits into
Open
chore(otel): delete a dead flag and fix a setting name that was never read#3859blarghmatey wants to merge 4 commits into
blarghmatey wants to merge 4 commits into
Conversation
… 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
OpenAPI ChangesShow/hide changesUnexpected changes? Ensure your branch is up-to-date with |
Contributor
There was a problem hiding this comment.
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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-observabilitydecides 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_SIZE→OPENTELEMETRY_BATCH_SIZE.telemetry.pyreadsOPENTELEMETRY_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_INSECUREis deliberately left alone. It is only consulted on the gRPC export path and no app setsOPENTELEMETRY_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_ENABLEDreturns nothing outside the comment explaining its removal, and nothing inmitol-django-observabilityever read it.OPENTELEMETRY_BATCH_SIZE: confirm the new name matches the library's lookup inmitol/observability/telemetry.py. After deploy, setting it to something other than 512 should now actually change theBatchSpanProcessorbatch 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.