jgosmann / dmarc-metrics-exporter

Export Prometheus metrics from DMARC reports.
MIT License
45 stars 7 forks source link

support for json logging #35

Closed schewara closed 7 months ago

schewara commented 1 year ago

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.

jgosmann commented 1 year ago

Great suggestion. Might take a while until I get around to implement this, but contributions would be welcome.

schewara commented 1 year ago

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?

jgosmann commented 1 year ago

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.

jgosmann commented 7 months ago

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:

schewara commented 7 months ago

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.