Closed schewara closed 7 months ago
Great suggestion. Might take a while until I get around to implement this, but contributions would be welcome.
I can try, but not promise. :wink:
Personally I think structlog is way more powerful then the python-json-logger, but would like to know, which option you would prefer?
I am not familiar with either and they both seem used by a fair bit of projects. Thus, I do not really have a preference.
I had a look at this today. I wouldn't use python-json-logger as the maintenance situation is currently unclear (madzak/python-json-logger#187). structlog seems to be better maintained, but also more complex. There are a few points that need attention when introducing this:
True, there has not been much progress in getting json logging support in Python and the docs also only provides some quirky solution to it.
Another alternative which i stumbled on is stlog, but seems rather new and time will tell how this develops.
The OpenTelemetry Python SDK is also still marked as experimental, but could be the preferred way forward now that Prometheus is also starting to support remote writes for OpenTelemetry metrics.
For better integration into the whole observability ecosystem, it would be great if the exporter would also allow to configure a json logging format by integrating python-json-logger or structlog.