[openstack-dev] [oslo][oslo.log] JSON logs are missing the request ID
Doug Hellmann
doug at doughellmann.com
Thu Jan 11 18:54:52 UTC 2018
Excerpts from Saverio Proto's message of 2018-01-11 15:23:46 +0100:
> Hello,
>
> we recently enabled the JSON logging to feed a Kibana dashboard and look
> at the logs with modern tooling.
>
> however it looks like in our Openstack Newton deployment that some
> information in the JSON files is missing.
>
> most important missing bit is the request-id, that we use to track an
> event across multiple log files on multiple hosts.
>
> Looking at the code it really looks like the request ID is there for the
> context formatter and not for the json formatter.
>
> https://github.com/openstack/oslo.log/blob/master/oslo_log/formatters.py#L208
>
> https://github.com/openstack/oslo.log/blob/master/oslo_log/formatters.py#L460
>
> I am an operator and a very bad python developer, so can anyone confirm
> that is really missing in the code, and it is not me configuring stuff
> wrongly ?
>
> If it is really missing the request-id in the json log formatter, should
> I open a bug about this ?
>
> thank you
>
> Saverio
>
The newton version of the JSONFormatter adds all of the values from the
context to the log record:
http://git.openstack.org/cgit/openstack/oslo.log/tree/oslo_log/formatters.py?h=newton-eol#n142
That should include the request_id.
Which service's logs are missing the request_id?
Chaining request_id values from one service to the next was a separate
piece of work, and I don't remember off the top of my head when that was
added. Perhaps someone else can. I think Sean Dague drove a lot of that
work.
Doug
More information about the OpenStack-dev
mailing list