mirror of
https://github.com/ansible/awx.git
synced 2026-03-19 01:47:31 -02:30
Rework which loggers we sent to OTEL
* Send all propagate=False loggers to OTEL AND the awx logger
This commit is contained in:
committed by
Chris Meyers
parent
cae42653bf
commit
6df47c8449
@@ -51,11 +51,18 @@ LOGGING['handlers']['otel'] |= {
|
|||||||
'class': 'awx.main.utils.handlers.OTLPHandler',
|
'class': 'awx.main.utils.handlers.OTLPHandler',
|
||||||
'endpoint': 'http://otel:4317',
|
'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():
|
for name in LOGGING['loggers'].keys():
|
||||||
handler = LOGGING['loggers'][name].get('handlers', [])
|
if not LOGGING['loggers'][name].get('propagate', True):
|
||||||
if 'otel' not in handler:
|
handler = LOGGING['loggers'][name].get('handlers', [])
|
||||||
LOGGING['loggers'][name].get('handlers', []).append('otel')
|
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 %}
|
{% endif %}
|
||||||
|
|
||||||
BROADCAST_WEBSOCKET_PORT = 8013
|
BROADCAST_WEBSOCKET_PORT = 8013
|
||||||
|
|||||||
Reference in New Issue
Block a user