mirror of
https://github.com/ansible/awx.git
synced 2026-02-26 15:36:04 -03:30
show user unsafe name
* We log stats using a safe hostname because of prometheus requirements. However, when we display users the hostname we should use the Instance hostname. This change outputs the Instance.hostname instead of the safe prometheus name.
This commit is contained in:
@@ -56,8 +56,8 @@ class Command(BaseCommand):
|
||||
host_stats = [('hostname', 'state', 'start time', 'duration (sec)')]
|
||||
for h in hostnames:
|
||||
connection_color = '91' # red
|
||||
h = safe_name(h)
|
||||
prefix = f'awx_{h}'
|
||||
h_safe = safe_name(h)
|
||||
prefix = f'awx_{h_safe}'
|
||||
connection_state = data.get(f'{prefix}_connection', 'N/A')
|
||||
connection_started = 'N/A'
|
||||
connection_duration = 'N/A'
|
||||
@@ -80,8 +80,8 @@ class Command(BaseCommand):
|
||||
def get_connection_stats(cls, me, hostnames, data):
|
||||
host_stats = [('hostname', 'total', 'per minute')]
|
||||
for h in hostnames:
|
||||
h = safe_name(h)
|
||||
prefix = f'awx_{h}'
|
||||
h_safe = safe_name(h)
|
||||
prefix = f'awx_{h_safe}'
|
||||
messages_total = data.get(f'{prefix}_messages_received', '0')
|
||||
messages_per_minute = data.get(f'{prefix}_messages_received_per_minute', '0')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user