googleapis / python-logging

Apache License 2.0
121 stars 52 forks source link

feat: support OpenTelemetry's LoggingInstrumentor #696

Open daniel-sanche opened 1 year ago

daniel-sanche commented 1 year ago

OpenTelemetry libraries inject trace and span info into Python LogRecords. If we support these fields in this library, it would make our trace-log correlation feature work for frameworks outside of Flask/Django

https://github.com/googleapis/python-logging/issues/505#issuecomment-1347392833

Megabytemb commented 12 months ago

Hey. Any movement on this feature?

It would be awesome to have correlated logs working right out of the box if you instrument with OpenTelemetry. https://cloud.google.com/logging/docs/view/correlate-logs#view-correlated-log-entries

This also then has the added benefit of linking it into Cloud Trace as well. Really seems like a good way to tie Google services together.