Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include tracking_label for vmdb-logger #183

Merged
merged 1 commit into from
Jun 23, 2017

Conversation

kbrock
Copy link
Member

@kbrock kbrock commented May 26, 2017

In workers, we have a global variable $_miq_worker_current_msg that holds the current MiqQueue message being processed. This puts a common identifier in logs to help find related logging messages.

We are transitioning away from task_id for MiqQueue because the concept is not transferrable to other queuing technologies.

This change allows us to still have a global tracking label/identifier. It also lets us get away from a global that is very implementation specific.

Also, it allows us to get away from using task_id in some areas of code that don't need it, and still get the benefits of having a common identifier in the logs.

This is related to ManageIQ/manageiq#15224

In the future, using an mdc for the log may be a better approach. This PR was just focused on removing the MiqQueue dependency and providing backwards compatibility.

@kbrock kbrock requested a review from Fryguy May 26, 2017 13:04
@Fryguy Fryguy added the util label May 26, 2017
@chessbyte chessbyte changed the title Include logging_task_id for vmdv-logger Include logging_task_id for vmdb-logger May 26, 2017
@kbrock kbrock force-pushed the logging_task_id branch 2 times, most recently from 1270265 to ee9daf0 Compare May 30, 2017 21:23
@kbrock kbrock changed the title Include logging_task_id for vmdb-logger Include request_id for vmdb-logger May 30, 2017
@kbrock
Copy link
Member Author

kbrock commented May 30, 2017

If you want me to remove the global here, then we can make this change in lock step with the one on manageiq/manageiq. up to you.

Also, let me know if you want to change the variable name request_id.

I chose the name request_id, because most of the versions of this code use request.uuid and call it request_id. While this name looks to be based upon an http request, it can also be generated in a scheduler or event stream.

If there is a tracking label (new) then lets log this

Use the global MiqQueue#task_id for backwards compatibility.
@kbrock kbrock force-pushed the logging_task_id branch from ee9daf0 to 507d4c7 Compare June 22, 2017 20:24
@miq-bot
Copy link
Member

miq-bot commented Jun 22, 2017

Checked commit kbrock@507d4c7 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
1 file checked, 1 offense detected

lib/gems/pending/util/vmdb-logger.rb

@kbrock kbrock requested a review from mkanoor June 22, 2017 20:28
@mkanoor
Copy link
Contributor

mkanoor commented Jun 22, 2017

👍
@Fryguy please review

@Fryguy Fryguy changed the title Include request_id for vmdb-logger Include tracking_label for vmdb-logger Jun 23, 2017
@Fryguy Fryguy merged commit a75ed11 into ManageIQ:master Jun 23, 2017
@Fryguy Fryguy added this to the Sprint 64 Ending Jul 3, 2017 milestone Jun 23, 2017
@kbrock kbrock deleted the logging_task_id branch June 23, 2017 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants