Dabz / ccloudexporter

Prometheus exporter for Confluent Cloud API metric
https://docs.confluent.io/current/cloud/metrics-api.html
87 stars 53 forks source link

Option to disable log pretty printing #58

Closed aaron-trout closed 3 years ago

aaron-trout commented 3 years ago

Multi line JSON logs are not getting parsed by our logging system, adding an optional flag to disable this with -log-pretty-print=false so that the whole JSON object is printed on one line. Defaulting to the existing behaviour.

Example:

$ ./ccloudexporter
{
  "level": "fatal",
  "msg": "CCLOUD_API_KEY environment variable has not been specified",
  "time": "2021-01-05T10:20:58Z"
}
$ ./ccloudexporter -log-pretty-print=false
{"level":"fatal","msg":"CCLOUD_API_KEY environment variable has not been specified","time":"2021-01-05T10:14:52Z"}
Dabz commented 3 years ago

Thanks for the PR ;) I reviewed & merged it. The docker images should be updated in a few minutes.