ansible/awx

Add fields to logs sent to logstash

Open

#13,570 opened on Feb 14, 2023

View on GitHub
 (0 comments) (1 reaction) (0 assignees)Python (3,333 forks)batch import
communityhelp wantedtype:enhancement

Repository metrics

Stars
 (13,071 stars)
PR merge metrics
 (Avg merge 24d 6h) (30 merged PRs in 30d)

Description

Please confirm the following

  • I agree to follow this project's code of conduct.
  • I have checked the current issues for duplicates.
  • I understand that AWX is open source software provided for free and that I might not receive a timely response.

Feature type

Enhancement to Existing Feature

Feature Summary

When a job is launched and AWX sends logs to logstash (I don't know if this happens with other log aggregators), I think it would be useful to have some fields added. For instance:

  • A field that shows the organization the job template belongs to
  • A field that shows the organization and/or team the user who launches them belongs to

The second one might be more tricky, but the first one is something that appears in the JSON from the API under summary_fields.organization.name (I don't know if this is somehow related, please forgive my ignorance on this)

Besides that, I have found the following happens:

  • When a job is launched, an event is sent notifying the job is "pending". But no event is received when the job ends. If we filter by field summary_fields.job.status:*, all results are either "pending" or "new", but never a "finished".
  • When a job is launched directly from a job template, it includes information about the user that launched it. However, if a job template is launched from a workflow job, this information isn't included. In the following images you can see the difference between some of the information received in elastic from two jobs launched either ways:

When launched from workflow job:

image

When launched from job template:

image

  • When a job is launched from a schedule, it doesn't include user information either, that could be coherent with what JSON in API shows, but it could be useful if, as that JSON, it at least showed that the job is scheduled.

Select the relevant components

  • UI
  • API
  • Docs
  • Collection
  • CLI
  • Other

Steps to reproduce

Launch jobs from AWX either directly from job template or through a workflow job

Current results

Some information does not appear in logstash logs that can be useful

Sugested feature result

Some more information appears in logstash logs

Additional information

No response

Contributor guide