Skip to content

disable django instrumentation if DJANGO_SETTINGS_MODULE is not set#549

Merged
wangzlei merged 3 commits intoaws-observability:mainfrom
wangzlei:main
Dec 9, 2025
Merged

disable django instrumentation if DJANGO_SETTINGS_MODULE is not set#549
wangzlei merged 3 commits intoaws-observability:mainfrom
wangzlei:main

Conversation

@wangzlei
Copy link
Contributor

@wangzlei wangzlei commented Dec 5, 2025

Issue #, if available:

When using the OpenTelemetry Django instrumentation, users must set the DJANGO_SETTINGS_MODULE environment variable before Python starts. Otherwise, Django will fail to launch because it cannot locate the required settings module.

Description of changes:
In the ADOT distribution, we can add logic so that if Django is installed, the Django instrumentation is enabled only when the DJANGO_SETTINGS_MODULE environment variable is present.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@wangzlei wangzlei requested a review from a team as a code owner December 5, 2025 22:03
@wangzlei wangzlei added the skip changelog doesn't need a CHANGELOG entry label Dec 5, 2025
@wangzlei wangzlei removed the skip changelog doesn't need a CHANGELOG entry label Dec 5, 2025
@wangzlei wangzlei enabled auto-merge (squash) December 5, 2025 22:24
@wangzlei wangzlei merged commit b33e262 into aws-observability:main Dec 9, 2025
16 checks passed
yiyuan-he pushed a commit to yiyuan-he/aws-otel-python-instrumentation that referenced this pull request Dec 12, 2025
…ws-observability#549)

*Issue #, if available:*

When using the OpenTelemetry Django instrumentation, users must set the
DJANGO_SETTINGS_MODULE environment variable before Python starts.
Otherwise, Django will fail to launch because it cannot locate the
required settings module.

*Description of changes:*
In the ADOT distribution, we can add logic so that if Django is
installed, the Django instrumentation is enabled only when the
DJANGO_SETTINGS_MODULE environment variable is present.

By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.
@yiyuan-he yiyuan-he mentioned this pull request Dec 12, 2025
yiyuan-he added a commit that referenced this pull request Dec 12, 2025
*Issue #, if available:*
N/A - Patch release preparation

**Description of changes:**

Cherry-pick commits from main to prepare v0.14.1 patch release:
  - #554 - Add custom ADOT UserAgent for OTLP Spans Exporter
- #552 - Refactor configuration for Application Signals Dimensions to
EMF exporter
  - #551 - CVE-2025-66471 fix (urllib3 dependency bump)
- #549 - Disable django instrumentation if DJANGO_SETTINGS_MODULE is not
set
  - #548 - Add Service and Environment dimensions to EMF metrics
  - #547 - Add safety check for bedrock ConverseStream responses
  - #546 - Fix python package distribution name case-sensitive issue

By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.

---------

Co-authored-by: Lei Wang <66336933+wangzlei@users.noreply.github.com>
Co-authored-by: Steve Liu <liustve@amazon.com>
Co-authored-by: Syed Ahsan Ishtiaque <176968742+syed-ahsan-ishtiaque@users.noreply.github.com>
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