summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Meyers <chris.meyers.fsu@gmail.com>2024-05-31 16:11:02 +0200
committerChris Meyers <chrismeyersfsu@users.noreply.github.com>2024-05-31 19:55:17 +0200
commit6df47c84490286946bd47c446ad9febab0f1503d (patch)
tree4b41b4dd5446d6ba321bf3a1fc49049344cb7b18
parentAdd recording (diff)
downloadawx-6df47c84490286946bd47c446ad9febab0f1503d.tar.xz
awx-6df47c84490286946bd47c446ad9febab0f1503d.zip
Rework which loggers we sent to OTEL
* Send all propagate=False loggers to OTEL AND the awx logger
-rw-r--r--tools/docker-compose/ansible/roles/sources/templates/local_settings.py.j215
1 files changed, 11 insertions, 4 deletions
diff --git a/tools/docker-compose/ansible/roles/sources/templates/local_settings.py.j2 b/tools/docker-compose/ansible/roles/sources/templates/local_settings.py.j2
index fa93ccecc5..42a5d56366 100644
--- a/tools/docker-compose/ansible/roles/sources/templates/local_settings.py.j2
+++ b/tools/docker-compose/ansible/roles/sources/templates/local_settings.py.j2
@@ -51,11 +51,18 @@ LOGGING['handlers']['otel'] |= {
'class': 'awx.main.utils.handlers.OTLPHandler',
'endpoint': 'http://otel:4317',
}
-# Add otel log handler to all log handlers
+# Add otel log handler to all log handlers where propagate is False
for name in LOGGING['loggers'].keys():
- handler = LOGGING['loggers'][name].get('handlers', [])
- if 'otel' not in handler:
- LOGGING['loggers'][name].get('handlers', []).append('otel')
+ if not LOGGING['loggers'][name].get('propagate', True):
+ handler = LOGGING['loggers'][name].get('handlers', [])
+ if 'otel' not in handler:
+ LOGGING['loggers'][name].get('handlers', []).append('otel')
+
+# Everything without explicit propagate=False ends up logging to 'awx' so add it
+handler = LOGGING['loggers']['awx'].get('handlers', [])
+if 'otel' not in handler:
+ LOGGING['loggers']['awx'].get('handlers', []).append('otel')
+
{% endif %}
BROADCAST_WEBSOCKET_PORT = 8013