ansible / awx

AWX provides a web-based user interface, REST API, and task engine built on top of Ansible. It is one of the upstream projects for Red Hat Ansible Automation Platform.
Other
13.96k stars 3.41k forks source link

Inventory Sync and Ad-Hoc Commands are not send in Logs #15302

Open valkiriaaquatica opened 3 months ago

valkiriaaquatica commented 3 months ago

Please confirm the following

Feature type

Enhancement to Existing Feature Logging

Feature Summary

Hi, I'm using AAP and AWX for production and development enviroments , I have Logstash (formerly ELK) as the logging tool for have a log control. I have used all the loggers that offer in the logging settings (as shown below) but when I want to get the logs from a Inventory Sync or a Ad-hoc command, not all the info that is shown in the IU or in API is shown in logs.

[
  "awx",
  "activity_stream",
  "job_events",
  "system_tracking",
  "broadcast_websocket"
]

Example: I sync a source of a Azure dynamic invetory, the log sent from AAP to logstash have the information of the background paybook used default that is project_udpate.yml playbook that Ansible uses default. That is fine, the problem comes when there is no information shown of the actual debug of inventory, as an example in the IU I receive this info where it gets the groups and hosts or in case of error also as an example

   21.385 INFO     Processing JSON output...
   21.388 INFO     Loaded 13 groups, 13 hosts
   21.578 INFO     Inventory import completed for 12345567in 0.2s

ERROR

[WARNING]:  * Failed to parse
/runner/project/azure/23456789.azure_rm.yml with
auto plugin: a batched request failed with status code 404, url /subscriptions/
23456789/providers/Microsoft.Compute/virtualMachine

So that debug info could be very useful to get it as an stdout send within the logs. Main reason to do this is to be able to make dashboards of accounts with certain type of problem to get it more organized.

Select the relevant components

Steps to reproduce

  1. Have a Inevtnory with some source prepared
  2. Deploy ELK (as a docker compose exmaple you can fllow tihis documentation which is really fast to deploy https://community.hetzner.com/tutorials/deploy-elk-stack-with-docker )
  3. Configure Logging in your AWX/AAP to send logs to the IP:port logstash configured
  4. Try to get the information of the debug of an inventory (no matter if its with error or not)

Current results

No logs of inventory debug are sent within the logs.

Sugested feature result

Add a new object in the Json or a new dict value like "stdout" where all the debug is collected so it can be analyzed after.

Additional information

No response

djyasin commented 3 months ago

Hello @valkiriaaquatica, Have you looked through our documentation regarding logging? If not, you can view that here You may be able to adjust the logs to suit your needs better. Please let us know if that helps!

valkiriaaquatica commented 3 months ago

Hi @djyasin , thanks for the repy. I've tried with te options show in the documentation and with different Logging Aggregator Level Threshold but I no log from inventory_update was sent.

In the api/v2 the information that I want to receive in logs is: https://aap.domain.com/api/v2/inventory_updates/12345/events/_ that is in json format or _https://aap.domain.com/api/v2/inventory_updates/72392/stdout/_ but not in json format.

In the latest documentation is nothing show about inventory_updates.. but searching i found on https://docs.ansible.com/ansible-tower/3.3.5/html/administration/logging.html old AWX version that was job_status , I've tried but still do not work (probably because after that version job_status was deprecated).

So I've not yet how to send these logs..

Thanks in advance!

thedoubl3j commented 2 months ago

Those endpoints are what you want to look at but they are not part of the log aggregator so they will not be found with the others.