-
|
Is your feature request related to a problem? Please describe. Currently, it appears the logging output of grafana-operator is semi-structured, but does not appear to conform to any standardized log format structure, lending to the need to configure a custom parser when processing logs. Grafana provides such a configuration option via logs.console/format, but I could not locate a similar configuration option within grafana-operator. (If applicable)If your feature request solves a bug please provide a link to the community issue Describe the solution you'd like Providing the ability to enable a fully structured and standards compliant log output such that logs can be processed without the need for special consideration specific to a particular container. https://betterstack.com/community/guides/logging/log-formatting/ Describe alternatives you've considered Additional context grafana-operator log output 2024-08-30T00:17:02Z INFO GrafanaDashboardReconciler found matching Grafana instances for dashboard {"controller": "grafanadashboard", "controllerGroup": "grafana.integreatly.org", "controllerKind": "GrafanaDashboard", "GrafanaDashboard": {"name":"cluster-and-node-status-dashboard","namespace":"grafana"}, "namespace": "grafana", "name": "cluster-and-node-status-dashboard", "reconcileID": "f1f1cead-a925-4eac-86f1-5b191b4e2cbb", "count": 1}
2024-08-30T00:17:02Z INFO GrafanaDashboardReconciler found matching Grafana instances for dashboard {"controller": "grafanadashboard", "controllerGroup": "grafana.integreatly.org", "controllerKind": "GrafanaDashboard", "GrafanaDashboard": {"name":"cluster-and-node-status-dashboard","namespace":"grafana"}, "namespace": "grafana", "name": "cluster-and-node-status-dashboard", "reconcileID": "de408fac-460d-4efa-b178-5d487673f4d4", "count": 1}
2024-08-30T00:17:03Z INFO GrafanaDashboardReconciler found matching Grafana instances for dashboard {"controller": "grafanadashboard", "controllerGroup": "grafana.integreatly.org", "controllerKind": "GrafanaDashboard", "GrafanaDashboard": {"name":"ctlfish-metrics-dashboard","namespace":"grafana"}, "namespace": "grafana", "name": "ctlfish-metrics-dashboard", "reconcileID": "b7686243-6f39-4e54-9c6a-504d1da7f4ea", "count": 1}grafana log output configured for json formatting {"duration":"23.60596ms","handler":"/api/v1/ngalert/admin_config","level":"info","logger":"context","method":"GET","msg":"Request Completed","orgId":1,"path":"/api/v1/ngalert/admin_config","referer":"https://dev1.edge-preprod.dev/grafana/alerting/admin","remote_addr":"104.129.205.128","size":59,"status":404,"status_source":"server","t":"2024-08-29T23:23:38.475133067Z","time_ms":23,"uname":"edge-grafana-admin","userId":1}
{"duration":"118.512241ms","level":"info","logger":"cleanup","msg":"Completed cleanup jobs","t":"2024-08-29T23:31:18.660370958Z"}
{"duration":"77.53366ms","level":"info","logger":"plugins.update.checker","msg":"Update check succeeded","t":"2024-08-29T23:31:18.778848751Z"}
{"duration":"73.213704ms","level":"info","logger":"cleanup","msg":"Completed cleanup jobs","t":"2024-08-29T23:41:18.614352634Z"}
{"duration":"95.26784ms","level":"info","logger":"plugins.update.checker","msg":"Update check succeeded","t":"2024-08-29T23:41:18.796069251Z"}Existing solutions |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
You can use the If you need this to be part of the helm chart, we're happy to review any PR regarding this topic |
Beta Was this translation helpful? Give feedback.
-
|
Thanks, I believe that will work for us. Might be worth mentioning in the docs in case anyone else has a similar question w/ regards to the log output formatting. Much obliged! |
Beta Was this translation helpful? Give feedback.
You can use the
-zap-encodercommand line argument to instruct the operator to log as JSON.If you need this to be part of the helm chart, we're happy to review any PR regarding this topic